home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / drivers / balsente.c < prev    next >
C/C++ Source or Header  |  2000-05-04  |  102KB  |  3,050 lines

  1. /***************************************************************************
  2.  
  3.     Bally/Sente SAC-1 system
  4.  
  5.     driver by Aaron Giles
  6.  
  7.  
  8.     Currently implemented:
  9.         * Chicken Shift
  10.         * Gimme a Break
  11.         * Goalie Ghost
  12.         * Hat Trick
  13.         * Mini Golf
  14.         * Name that Tune
  15.         * Night Stocker
  16.         * Off the Wall
  17.         * Rescue Raider
  18.         * Sente Diagnostic Cartridge
  19.         * Snacks'n Jaxson
  20.         * Snake Pit
  21.         * Spiker
  22.         * Stocker
  23.         * Street Football
  24.         * Toggle
  25.         * Trivial Pursuit (Genus I)
  26.         * Trivial Pursuit (Genus II)
  27.         * Trivial Pursuit (All Sports Edition)
  28.         * Trivial Pursuit (Young Player's Edition)
  29.         * Trivial Pursuit (Baby Boomer Series)
  30.  
  31.     Looking for ROMs for these:
  32.         * Euro Stocker
  33.         * Stompin'
  34.         * Strike Avenger
  35.         * Team Hat Trick
  36.         * Trick Shot
  37.         * Trivial Pursuit (Spanish)
  38.  
  39.     Unknowns:
  40.         * Snack Attack (may be another name for Snacks'n Jaxson)
  41.  
  42. ****************************************************************************
  43.  
  44.     Memory map
  45.  
  46. ****************************************************************************
  47.  
  48.     ========================================================================
  49.     CPU #1
  50.     ========================================================================
  51.     0000-007F   R/W   xxxxxxxx    Sprite RAM (32 entries x 4 bytes)
  52.                 R/W   x-------       (0: Vertical flip)
  53.                 R/W   -x------       (0: Horizontal flip)
  54.                 R/W   ------xx       (0: Upper 2 bits of image number)
  55.                 R/W   xxxxxxxx       (1: Lower 8 bits of image number)
  56.                 R/W   xxxxxxxx       (2: Y position, offset by 17 pixels)
  57.                 R/W   xxxxxxxx       (3: X position)
  58.     0080-00DF   R/W   xxxxxxxx    Program RAM
  59.     00E0-00FF   R/W   xxxxxxxx    Additional sprite RAM (8 entries x 4 bytes)
  60.     0100-07FF   R/W   xxxxxxxx    Program RAM
  61.     0800-7FFF   R/W   xxxxxxxx    Video RAM (256x240 pixels)
  62.                 R/W   xxxx----       (left pixel)
  63.                 R/W   ----xxxx       (right pixel)
  64.     8000-8FFF   R/W   ----xxxx    Palette RAM (1024 entries x 4 bytes)
  65.                 R/W   ----xxxx       (0: red entry)
  66.                 R/W   ----xxxx       (1: green entry)
  67.                 R/W   ----xxxx       (2: blue entry)
  68.     9000-9007     W   --------    ADC start trigger, inputs 0-7
  69.     9400        R     xxxxxxxx    ADC data read
  70.     9800-9801     W   x-------    External output #0
  71.     9802-9803     W   x-------    External output #1
  72.     9804-9805     W   x-------    External output #2
  73.     9806-9807     W   x-------    External output #3
  74.     9808-9809     W   x-------    External output #4
  75.     980A-980B     W   x-------    External output #5
  76.     980C-980D     W   x-------    External output #6
  77.     980E-980F     W   x-------    NVRAM recall
  78.     9880          W   --------    Random number generator reset
  79.     98A0          W   -xxx----    A000-DFFF bank select
  80.     98C0          W   ------xx    Palette bank select
  81.     98E0          W   --------    Watchdog reset
  82.     9900        R     xxxxxxxx    DIP switch bank 1 (G) (active low)
  83.     9901        R     xxxxxxxx    DIP switch bank 2 (H) (active low)
  84.     9902        R     x-------    Self test (active low)
  85.                 R     -x------    Left coin (active low)
  86.                 R     --xxxxxx    External inputs (active low)
  87.     9903        R     x-------    VBLANK state (active high)
  88.                 R     -x------    Right coin (active low)
  89.                 R     --xxxx--    External inputs (active low)
  90.                 R     ------x-    Player 2 start (active low)
  91.                 R     -------x    Player 1 start (active low)
  92.     9A00        R     xxxxxxxx    Random number generator
  93.     9A04-9A05   R/W   xxxxxxxx    6850 UART I/O (to sound board)
  94.     9B00-9CFF   R/W   xxxxxxxx    NOVRAM
  95.     9F00          W   --x--xxx    Independent bank select (Night Stocker only?)
  96.     A000-BFFF   R     xxxxxxxx    Banked A/B ROM
  97.     C000-DFFF   R     xxxxxxxx    Banked C/D ROM
  98.     E000-FFFF   R     xxxxxxxx    Fixed program ROM
  99.     ========================================================================
  100.     Interrupts:
  101.         NMI not connected
  102.         IRQ generated by 32L
  103.         FIRQ generated by 6850 UART
  104.     ========================================================================
  105.  
  106.  
  107.     ========================================================================
  108.     CPU #2
  109.     ========================================================================
  110.     0000-1FFF   R     xxxxxxxx    Program ROM
  111.     2000-3FFF   R/W   xxxxxxxx    Option RAM/ROM (assumed to be RAM for now)
  112.     4000-5FFF   R/W   xxxxxxxx    Program RAM
  113.     6000-6001     W   xxxxxxxx    6850 UART output (to main board)
  114.     E000-E001   R     xxxxxxxx    6850 UART input (from main board)
  115.     ========================================================================
  116.     0000-0003   R/W   xxxxxxxx    8253 counter chip I/O
  117.     0008        R     ------xx    Counter state
  118.                 R     ------x-    State of counter #0 OUT signal (active high)
  119.                 R     -------x    State of flip-flop feeding counter #0 (active low)
  120.     0008          W   --xxxxxx    Counter control
  121.                   W   --x-----    NMI enable (1=enabled, 0=disabled/clear)
  122.                   W   ---x----    CLEAR on flip-flop feeding counter #0 (active low)
  123.                   W   ----x---    Input of flip-flop feeding counter #0
  124.                   W   -----x--    PRESET on flip-flop feeding counter #0 (active low)
  125.                   W   ------x-    GATE signal for counter #0 (active high)
  126.                   W   -------x    Audio enable
  127.     000A          W   --xxxxxx    DAC data latch (upper 6 bits)
  128.     000B          W   xxxxxx--    DAC data latch (lower 6 bits)
  129.     000C          W   -----xxx    CEM3394 register select
  130.     000E          W   --xxxxxx    CEM3394 chip enable (active high)
  131.                   W   --x-----    CEM3394 chip 0 enable
  132.                   W   ---x----    CEM3394 chip 1 enable
  133.                   W   ----x---    CEM3394 chip 2 enable
  134.                   W   -----x--    CEM3394 chip 3 enable
  135.                   W   ------x-    CEM3394 chip 4 enable
  136.                   W   -------x    CEM3394 chip 5 enable
  137.     ========================================================================
  138.     Interrupts:
  139.         INT generated by counter #2 OUT signal on 8253
  140.         NMI generated by 6850 UART
  141.     ========================================================================
  142.  
  143. ***************************************************************************/
  144.  
  145.  
  146. #include "driver.h"
  147. #include "cpu/m6809/m6809.h"
  148. #include "vidhrdw/generic.h"
  149. #include <math.h>
  150.  
  151.  
  152.  
  153. /* video driver data & functions */
  154. int balsente_vh_start(void);
  155. void balsente_vh_stop(void);
  156. void balsente_vh_screenrefresh(struct osd_bitmap *bitmap, int full_refresh);
  157.  
  158. WRITE_HANDLER( balsente_videoram_w );
  159. WRITE_HANDLER( balsente_paletteram_w );
  160. WRITE_HANDLER( balsente_palette_select_w );
  161.  
  162.  
  163. /* local prototypes */
  164. static void poly17_init(void);
  165. static void counter_set_out(int which, int gate);
  166. static WRITE_HANDLER( m6850_w );
  167. static WRITE_HANDLER( m6850_sound_w );
  168. static void counter_callback(int param);
  169.  
  170.  
  171. /* global data */
  172. UINT8 balsente_shooter;
  173. UINT8 balsente_shooter_x;
  174. UINT8 balsente_shooter_y;
  175.  
  176.  
  177. /* 8253 counter state */
  178. struct counter_state
  179. {
  180.     void *timer;
  181.     INT32 initial;
  182.     INT32 count;
  183.     UINT8 gate;
  184.     UINT8 out;
  185.     UINT8 mode;
  186.     UINT8 readbyte;
  187.     UINT8 writebyte;
  188. };
  189.  
  190. static struct counter_state counter[3];
  191.  
  192. /* manually clocked counter 0 states */
  193. static UINT8 counter_control;
  194. static UINT8 counter_0_ff;
  195. static void *counter_0_timer;
  196.  
  197. /* random number generator states */
  198. static UINT8 *poly17 = NULL;
  199. static UINT8 *rand17 = NULL;
  200.  
  201. /* ADC I/O states */
  202. static INT8 analog_input_data[4];
  203. static UINT8 adc_value;
  204. static UINT8 adc_shift;
  205.  
  206. /* CEM3394 DAC control states */
  207. static UINT16 dac_value;
  208. static UINT8 dac_register;
  209. static UINT8 chip_select;
  210.  
  211. /* main CPU 6850 states */
  212. static UINT8 m6850_status;
  213. static UINT8 m6850_control;
  214. static UINT8 m6850_input;
  215. static UINT8 m6850_output;
  216. static UINT8 m6850_data_ready;
  217.  
  218. /* sound CPU 6850 states */
  219. static UINT8 m6850_sound_status;
  220. static UINT8 m6850_sound_control;
  221. static UINT8 m6850_sound_input;
  222. static UINT8 m6850_sound_output;
  223.  
  224. /* noise generator states */
  225. static UINT32 noise_position[6];
  226.  
  227. /* game-specific states */
  228. static UINT8 nstocker_bits;
  229. static UINT8 spiker_expand_color;
  230. static UINT8 spiker_expand_bgcolor;
  231. static UINT8 spiker_expand_bits;
  232.  
  233.  
  234.  
  235. static unsigned char *nvram;
  236. static size_t nvram_size;
  237.  
  238. static void nvram_handler(void *file, int read_or_write)
  239. {
  240.     if (read_or_write)
  241.         osd_fwrite(file,nvram,nvram_size);
  242.     else
  243.     {
  244.         if (file)
  245.             osd_fread(file,nvram,nvram_size);
  246.         else
  247.             memset(nvram,0,nvram_size);
  248.     }
  249. }
  250.  
  251.  
  252.  
  253. /*************************************
  254.  *
  255.  *    Interrupt handling
  256.  *
  257.  *************************************/
  258.  
  259. static void irq_off(int param)
  260. {
  261.     cpu_set_irq_line(0, M6809_IRQ_LINE, CLEAR_LINE);
  262. }
  263.  
  264.  
  265. static void interrupt_timer(int param)
  266. {
  267.     /* next interrupt after scanline 256 is scanline 64 */
  268.     if (param == 256)
  269.         timer_set(cpu_getscanlinetime(64), 64, interrupt_timer);
  270.     else
  271.         timer_set(cpu_getscanlinetime(param + 64), param + 64, interrupt_timer);
  272.  
  273.     /* IRQ starts on scanline 0, 64, 128, etc. */
  274.     cpu_set_irq_line(0, M6809_IRQ_LINE, ASSERT_LINE);
  275.  
  276.     /* it will turn off on the next HBLANK */
  277.     timer_set(cpu_getscanlineperiod() * 0.9, 0, irq_off);
  278.  
  279.     /* if we're a shooter, we do a little more work */
  280.     if (balsente_shooter)
  281.     {
  282.         UINT8 tempx, tempy;
  283.  
  284.         /* we latch the beam values on the first interrupt after VBLANK */
  285.         if (param == 64 && balsente_shooter)
  286.         {
  287.             balsente_shooter_x = input_port_8_r(0);
  288.             balsente_shooter_y = input_port_9_r(0);
  289.         }
  290.  
  291.         /* which bits get returned depends on which scanline we're at */
  292.         tempx = balsente_shooter_x << ((param - 64) / 64);
  293.         tempy = balsente_shooter_y << ((param - 64) / 64);
  294.         nstocker_bits = ((tempx >> 4) & 0x08) | ((tempx >> 1) & 0x04) |
  295.                         ((tempy >> 6) & 0x02) | ((tempy >> 3) & 0x01);
  296.     }
  297. }
  298.  
  299.  
  300. static void init_machine(void)
  301. {
  302.     /* create the polynomial tables */
  303.     poly17_init();
  304.  
  305.     /* reset counters; counter 2's gate is tied high */
  306.     memset(counter, 0, sizeof(counter));
  307.     counter[2].gate = 1;
  308.  
  309.     /* reset the manual counter 0 clock */
  310.     counter_control = 0x00;
  311.     counter_0_ff = 0;
  312.     counter_0_timer = NULL;
  313.  
  314.     /* reset the ADC states */
  315.     adc_value = 0;
  316.  
  317.     /* reset the CEM3394 I/O states */
  318.     dac_value = 0;
  319.     dac_register = 0;
  320.     chip_select = 0x3f;
  321.  
  322.     /* reset the 6850 chips */
  323.     m6850_w(0, 3);
  324.     m6850_sound_w(0, 3);
  325.  
  326.     /* reset the noise generator */
  327.     memset(noise_position, 0, sizeof(noise_position));
  328.  
  329.     /* point the banks to bank 0 */
  330.     cpu_setbank(1, &memory_region(REGION_CPU1)[0x10000]);
  331.     cpu_setbank(2, &memory_region(REGION_CPU1)[0x12000]);
  332.  
  333.     /* start a timer to generate interrupts */
  334.     timer_set(cpu_getscanlinetime(0), 0, interrupt_timer);
  335. }
  336.  
  337.  
  338.  
  339. /*************************************
  340.  *
  341.  *    MM5837 noise generator
  342.  *
  343.  *    NOTE: this is stolen straight from
  344.  *            POKEY.c
  345.  *
  346.  *************************************/
  347.  
  348. #define POLY17_BITS 17
  349. #define POLY17_SIZE ((1 << POLY17_BITS) - 1)
  350. #define POLY17_SHL    7
  351. #define POLY17_SHR    10
  352. #define POLY17_ADD    0x18000
  353.  
  354. static void poly17_init(void)
  355. {
  356.     UINT32 i, x = 0;
  357.     UINT8 *p, *r;
  358.  
  359.     /* free stale memory */
  360.     if (poly17)
  361.         free(poly17);
  362.     poly17 = rand17 = NULL;
  363.  
  364.     /* allocate memory */
  365.     p = poly17 = malloc(2 * (POLY17_SIZE + 1));
  366.     if (!poly17)
  367.         return;
  368.     r = rand17 = poly17 + POLY17_SIZE + 1;
  369.  
  370.     /* generate the polynomial */
  371.     for (i = 0; i < POLY17_SIZE; i++)
  372.     {
  373.         /* store new values */
  374.         *p++ = x & 1;
  375.         *r++ = x >> 3;
  376.  
  377.         /* calculate next bit */
  378.         x = ((x << POLY17_SHL) + (x >> POLY17_SHR) + POLY17_ADD) & POLY17_SIZE;
  379.     }
  380. }
  381.  
  382.  
  383. static void noise_gen(int chip, int count, short *buffer)
  384. {
  385.     if (Machine->sample_rate)
  386.     {
  387.         /* noise generator runs at 100kHz */
  388.         UINT32 step = (100000 << 14) / Machine->sample_rate;
  389.         UINT32 noise_counter = noise_position[chip];
  390.  
  391.         /* try to use the poly17 if we can */
  392.         if (poly17)
  393.         {
  394.             while (count--)
  395.             {
  396.                 *buffer++ = poly17[(noise_counter >> 14) & POLY17_SIZE] << 12;
  397.                 noise_counter += step;
  398.             }
  399.         }
  400.  
  401.         /* otherwise just use random numbers */
  402.         else
  403.         {
  404.             while (count--)
  405.                 *buffer++ = rand() & 0x1000;
  406.         }
  407.  
  408.         /* remember the noise position */
  409.         noise_position[chip] = noise_counter;
  410.     }
  411. }
  412.  
  413.  
  414.  
  415. /*************************************
  416.  *
  417.  *    Hardware random numbers
  418.  *
  419.  *************************************/
  420.  
  421. static WRITE_HANDLER( random_reset_w )
  422. {
  423.     /* reset random number generator */
  424. }
  425.  
  426.  
  427. static READ_HANDLER( random_num_r )
  428. {
  429.     unsigned int cc;
  430.  
  431.     /* CPU runs at 1.25MHz, noise source at 100kHz --> multiply by 12.5 */
  432.     cc = cpu_gettotalcycles();
  433.  
  434.     /* 12.5 = 8 + 4 + 0.5 */
  435.     cc = (cc << 3) + (cc << 2) + (cc >> 1);
  436.     return rand17[cc & POLY17_SIZE];
  437. }
  438.  
  439.  
  440.  
  441. /*************************************
  442.  *
  443.  *    ROM banking
  444.  *
  445.  *************************************/
  446.  
  447. static WRITE_HANDLER( rombank_select_w )
  448. {
  449.     int bank_offset = 0x6000 * ((data >> 4) & 7);
  450.  
  451. logerror("%04X:rombank_select_w(%02X)\n", cpu_getpreviouspc(), data);
  452.  
  453.     /* the bank number comes from bits 4-6 */
  454.     cpu_setbank(1, &memory_region(REGION_CPU1)[0x10000 + bank_offset]);
  455.     cpu_setbank(2, &memory_region(REGION_CPU1)[0x12000 + bank_offset]);
  456. }
  457.  
  458.  
  459. static WRITE_HANDLER( rombank2_select_w )
  460. {
  461.     /* Night Stocker and Name that Tune only so far.... */
  462.     int bank = data & 7;
  463.  
  464.     /* top bit controls which half of the ROMs to use (Name that Tune only) */
  465.     if (memory_region_length(REGION_CPU1) > 0x40000) bank |= (data >> 4) & 8;
  466.  
  467. //logerror("%04X:rombank2_select_w(%02X)\n", cpu_getpreviouspc(), data);
  468.  
  469.     /* when they set the AB bank, it appears as though the CD bank is reset */
  470.     if (data & 0x20)
  471.     {
  472.         cpu_setbank(1, &memory_region(REGION_CPU1)[0x10000 + 0x6000 * bank]);
  473.         cpu_setbank(2, &memory_region(REGION_CPU1)[0x12000 + 0x6000 * 6]);
  474.     }
  475.  
  476.     /* set both banks */
  477.     else
  478.     {
  479.         cpu_setbank(1, &memory_region(REGION_CPU1)[0x10000 + 0x6000 * bank]);
  480.         cpu_setbank(2, &memory_region(REGION_CPU1)[0x12000 + 0x6000 * bank]);
  481.     }
  482. }
  483.  
  484.  
  485.  
  486. /*************************************
  487.  *
  488.  *    Special outputs
  489.  *
  490.  *************************************/
  491.  
  492. static WRITE_HANDLER( misc_output_w )
  493. {
  494.     offset = (offset / 4) % 8;
  495.     data >>= 7;
  496.  
  497.     /* these are generally used to control the various lamps */
  498.     /* special case is offset 7, which recalls the NVRAM data */
  499.     if (offset == 7)
  500.     {
  501.         logerror("nvrecall_w=%d\n", data);
  502.     }
  503.     else
  504.     {
  505. //        osd_led_w(offset, data);
  506.     }
  507. }
  508.  
  509.  
  510.  
  511. /*************************************
  512.  *
  513.  *    6850 UART communications
  514.  *
  515.  *************************************/
  516.  
  517. static void m6850_update_io(void)
  518. {
  519.     UINT8 new_state;
  520.  
  521.     /* sound -> main CPU communications */
  522.     if (!(m6850_sound_status & 0x02))
  523.     {
  524.         /* set the overrun bit if the data in the destination hasn't been read yet */
  525.         if (m6850_status & 0x01)
  526.             m6850_status |= 0x20;
  527.  
  528.         /* copy the sound's output to our input */
  529.         m6850_input = m6850_sound_output;
  530.  
  531.         /* set the receive register full bit */
  532.         m6850_status |= 0x01;
  533.  
  534.         /* set the sound's trasmitter register empty bit */
  535.         m6850_sound_status |= 0x02;
  536.     }
  537.  
  538.     /* main -> sound CPU communications */
  539.     if (m6850_data_ready)
  540.     {
  541.         /* set the overrun bit if the data in the destination hasn't been read yet */
  542.         if (m6850_sound_status & 0x01)
  543.             m6850_sound_status |= 0x20;
  544.  
  545.         /* copy the main CPU's output to our input */
  546.         m6850_sound_input = m6850_output;
  547.  
  548.         /* set the receive register full bit */
  549.         m6850_sound_status |= 0x01;
  550.  
  551.         /* set the main CPU's trasmitter register empty bit */
  552.         m6850_status |= 0x02;
  553.         m6850_data_ready = 0;
  554.     }
  555.  
  556.     /* check for reset states */
  557.     if ((m6850_control & 3) == 3)
  558.     {
  559.         m6850_status = 0x02;
  560.         m6850_data_ready = 0;
  561.     }
  562.     if ((m6850_sound_control & 3) == 3)
  563.         m6850_sound_status = 0x02;
  564.  
  565.     /* check for transmit/receive IRQs on the main CPU */
  566.     new_state = 0;
  567.     if ((m6850_control & 0x80) && (m6850_status & 0x21)) new_state = 1;
  568.     if ((m6850_control & 0x60) == 0x20 && (m6850_status & 0x02)) new_state = 1;
  569.  
  570.     /* apply the change */
  571.     if (new_state && !(m6850_status & 0x80))
  572.     {
  573.         cpu_set_irq_line(0, M6809_FIRQ_LINE, ASSERT_LINE);
  574.         m6850_status |= 0x80;
  575.     }
  576.     else if (!new_state && (m6850_status & 0x80))
  577.     {
  578.         cpu_set_irq_line(0, M6809_FIRQ_LINE, CLEAR_LINE);
  579.         m6850_status &= ~0x80;
  580.     }
  581.  
  582.     /* check for transmit/receive IRQs on the sound CPU */
  583.     new_state = 0;
  584.     if ((m6850_sound_control & 0x80) && (m6850_sound_status & 0x21)) new_state = 1;
  585.     if ((m6850_sound_control & 0x60) == 0x20 && (m6850_sound_status & 0x02)) new_state = 1;
  586.     if (!(counter_control & 0x20)) new_state = 0;
  587.  
  588.     /* apply the change */
  589.     if (new_state && !(m6850_sound_status & 0x80))
  590.     {
  591.         cpu_set_nmi_line(1, ASSERT_LINE);
  592.         m6850_sound_status |= 0x80;
  593.     }
  594.     else if (!new_state && (m6850_sound_status & 0x80))
  595.     {
  596.         cpu_set_nmi_line(1, CLEAR_LINE);
  597.         m6850_sound_status &= ~0x80;
  598.     }
  599. }
  600.  
  601.  
  602.  
  603. /*************************************
  604.  *
  605.  *    6850 UART (main CPU)
  606.  *
  607.  *************************************/
  608.  
  609. static READ_HANDLER( m6850_r )
  610. {
  611.     int result;
  612.  
  613.     /* status register is at offset 0 */
  614.     if (offset == 0)
  615.     {
  616.         result = m6850_status;
  617.     }
  618.  
  619.     /* input register is at offset 1 */
  620.     else
  621.     {
  622.         result = m6850_input;
  623.  
  624.         /* clear the overrun and receive buffer full bits */
  625.         m6850_status &= ~0x21;
  626.         m6850_update_io();
  627.     }
  628.  
  629.     return result;
  630. }
  631.  
  632.  
  633. static void m6850_data_ready_callback(int param)
  634. {
  635.     /* set the output data byte and indicate that we're ready to go */
  636.     m6850_output = param;
  637.     m6850_data_ready = 1;
  638.     m6850_update_io();
  639. }
  640.  
  641.  
  642. static void m6850_w_callback(int param)
  643. {
  644.     /* indicate that the transmit buffer is no longer empty and update the I/O state */
  645.     m6850_status &= ~0x02;
  646.     m6850_update_io();
  647.  
  648.     /* set a timer for 500usec later to actually transmit the data */
  649.     /* (this is very important for several games, esp Snacks'n Jaxson) */
  650.     timer_set(TIME_IN_USEC(500), param, m6850_data_ready_callback);
  651. }
  652.  
  653.  
  654. static WRITE_HANDLER( m6850_w )
  655. {
  656.     /* control register is at offset 0 */
  657.     if (offset == 0)
  658.     {
  659.         m6850_control = data;
  660.  
  661.         /* re-update since interrupt enables could have been modified */
  662.         m6850_update_io();
  663.     }
  664.  
  665.     /* output register is at offset 1; set a timer to synchronize the CPUs */
  666.     else
  667.         timer_set(TIME_NOW, data, m6850_w_callback);
  668. }
  669.  
  670.  
  671.  
  672. /*************************************
  673.  *
  674.  *    6850 UART (sound CPU)
  675.  *
  676.  *************************************/
  677.  
  678. static READ_HANDLER( m6850_sound_r )
  679. {
  680.     int result;
  681.  
  682.     /* status register is at offset 0 */
  683.     if (offset == 0)
  684.     {
  685.         result = m6850_sound_status;
  686.     }
  687.  
  688.     /* input register is at offset 1 */
  689.     else
  690.     {
  691.         result = m6850_sound_input;
  692.  
  693.         /* clear the overrun and receive buffer full bits */
  694.         m6850_sound_status &= ~0x21;
  695.         m6850_update_io();
  696.     }
  697.  
  698.     return result;
  699. }
  700.  
  701.  
  702. static WRITE_HANDLER( m6850_sound_w )
  703. {
  704.     /* control register is at offset 0 */
  705.     if (offset == 0)
  706.         m6850_sound_control = data;
  707.  
  708.     /* output register is at offset 1 */
  709.     else
  710.     {
  711.         m6850_sound_output = data;
  712.         m6850_sound_status &= ~0x02;
  713.     }
  714.  
  715.     /* re-update since interrupt enables could have been modified */
  716.     m6850_update_io();
  717. }
  718.  
  719.  
  720.  
  721. /*************************************
  722.  *
  723.  *    ADC handlers
  724.  *
  725.  *************************************/
  726.  
  727. static int update_analog_inputs(void)
  728. {
  729.     int i;
  730.  
  731.     /* the analog input system helpfully scales the value read by the percentage of time */
  732.     /* into the current frame we are; unfortunately, this is bad for us, since the analog */
  733.     /* ports are read once a frame, just at varying intervals. To get around this, we */
  734.     /* read all the analog inputs at VBLANK time and just return the cached values. */
  735.     for (i = 0; i < 4; i++)
  736.         analog_input_data[i] = readinputport(4 + i);
  737.  
  738.     /* don't actually generate an interrupt here */
  739.     return ignore_interrupt();
  740. }
  741.  
  742.  
  743. static void adc_finished(int which)
  744. {
  745.     /* analog controls are read in two pieces; the lower port returns the sign */
  746.     /* and the upper port returns the absolute value of the magnitude */
  747.     int val = analog_input_data[which / 2] << adc_shift;
  748.  
  749.     /* push everything out a little bit extra; most games seem to have a dead */
  750.     /* zone in the middle that feels unnatural with the mouse */
  751.     if (val < 0) val -= 8;
  752.     else if (val > 0) val += 8;
  753.  
  754.     /* clip to 0xff maximum magnitude */
  755.     if (val < -0xff) val = -0xff;
  756.     else if (val > 0xff) val = 0xff;
  757.  
  758.     /* return the sign */
  759.     if (!(which & 1))
  760.         adc_value = (val < 0) ? 0xff : 0x00;
  761.  
  762.     /* return the magnitude */
  763.     else
  764.         adc_value = (val < 0) ? -val : val;
  765. }
  766.  
  767.  
  768. static READ_HANDLER( adc_data_r )
  769. {
  770.     /* just return the last value read */
  771.     return adc_value;
  772. }
  773.  
  774.  
  775. static WRITE_HANDLER( adc_select_w )
  776. {
  777.     /* set a timer to go off and read the value after 50us */
  778.     /* it's important that we do this for Mini Golf */
  779.     timer_set(TIME_IN_USEC(50), offset & 7, adc_finished);
  780. }
  781.  
  782.  
  783.  
  784. /*************************************
  785.  *
  786.  *    8253-5 timer utilities
  787.  *
  788.  *    NOTE: this is far from complete!
  789.  *
  790.  *************************************/
  791.  
  792. INLINE void counter_start(int which)
  793. {
  794.     /* don't start a timer for channel 0; it is clocked manually */
  795.     if (which != 0)
  796.     {
  797.         /* only start a timer if we're gated and there is none already */
  798.         if (counter[which].gate && !counter[which].timer)
  799.             counter[which].timer = timer_set(TIME_IN_HZ(2000000) * (double)counter[which].count, which, counter_callback);
  800.     }
  801. }
  802.  
  803.  
  804. INLINE void counter_stop(int which)
  805. {
  806.     /* only stop the timer if it exists */
  807.     if (counter[which].timer)
  808.         timer_remove(counter[which].timer);
  809.     counter[which].timer = NULL;
  810. }
  811.  
  812.  
  813. INLINE void counter_update_count(int which)
  814. {
  815.     /* only update if the timer is running */
  816.     if (counter[which].timer)
  817.     {
  818.         /* determine how many 2MHz cycles are remaining */
  819.         int count = (int)(timer_timeleft(counter[which].timer) / TIME_IN_HZ(2000000));
  820.         counter[which].count = (count < 0) ? 0 : count;
  821.     }
  822. }
  823.  
  824.  
  825.  
  826. /*************************************
  827.  *
  828.  *    8253-5 timer internals
  829.  *
  830.  *    NOTE: this is far from complete!
  831.  *
  832.  *************************************/
  833.  
  834. static void counter_set_gate(int which, int gate)
  835. {
  836.     int oldgate = counter[which].gate;
  837.  
  838.     /* remember the gate state */
  839.     counter[which].gate = gate;
  840.  
  841.     /* if the counter is being halted, update the count and remove the system timer */
  842.     if (!gate && oldgate)
  843.     {
  844.         counter_update_count(which);
  845.         counter_stop(which);
  846.     }
  847.  
  848.     /* if the counter is being started, create the timer */
  849.     else if (gate && !oldgate)
  850.     {
  851.         /* mode 1 waits for the gate to trigger the counter */
  852.         if (counter[which].mode == 1)
  853.         {
  854.             counter_set_out(which, 0);
  855.  
  856.             /* add one to the count; technically, OUT goes low on the next clock pulse */
  857.             /* and then starts counting down; it's important that we don't count the first one */
  858.             counter[which].count = counter[which].initial + 1;
  859.         }
  860.  
  861.         /* start the counter */
  862.         counter_start(which);
  863.     }
  864. }
  865.  
  866.  
  867. static void counter_set_out(int which, int out)
  868. {
  869.     /* OUT on counter 2 is hooked to the /INT line on the Z80 */
  870.     if (which == 2)
  871.         cpu_set_irq_line(1, 0, out ? ASSERT_LINE : CLEAR_LINE);
  872.  
  873.     /* OUT on counter 0 is hooked to the GATE line on counter 1 */
  874.     else if (which == 0)
  875.         counter_set_gate(1, !out);
  876.  
  877.     /* remember the out state */
  878.     counter[which].out = out;
  879. }
  880.  
  881.  
  882. static void counter_callback(int param)
  883. {
  884.     /* reset the counter and the count */
  885.     counter[param].timer = NULL;
  886.     counter[param].count = 0;
  887.  
  888.     /* set the state of the OUT line */
  889.     /* mode 0 and 1: when firing, transition OUT to high */
  890.     if (counter[param].mode == 0 || counter[param].mode == 1)
  891.         counter_set_out(param, 1);
  892.  
  893.     /* no other modes handled currently */
  894. }
  895.  
  896.  
  897.  
  898. /*************************************
  899.  *
  900.  *    8253-5 timer handlers
  901.  *
  902.  *    NOTE: this is far from complete!
  903.  *
  904.  *************************************/
  905.  
  906. static READ_HANDLER( counter_8253_r )
  907. {
  908.     int which;
  909.  
  910.     switch (offset & 3)
  911.     {
  912.         case 0:
  913.         case 1:
  914.         case 2:
  915.             /* warning: assumes LSB/MSB addressing and no latching! */
  916.             which = offset & 3;
  917.  
  918.             /* update the count */
  919.             counter_update_count(which);
  920.  
  921.             /* return the LSB */
  922.             if (counter[which].readbyte == 0)
  923.             {
  924.                 counter[which].readbyte = 1;
  925.                 return counter[which].count & 0xff;
  926.             }
  927.  
  928.             /* write the MSB and reset the counter */
  929.             else
  930.             {
  931.                 counter[which].readbyte = 0;
  932.                 return (counter[which].count >> 8) & 0xff;
  933.             }
  934.             break;
  935.     }
  936.     return 0;
  937. }
  938.  
  939.  
  940. static WRITE_HANDLER( counter_8253_w )
  941. {
  942.     int which;
  943.  
  944.     switch (offset & 3)
  945.     {
  946.         case 0:
  947.         case 1:
  948.         case 2:
  949.             /* warning: assumes LSB/MSB addressing and no latching! */
  950.             which = offset & 3;
  951.  
  952.             /* if the counter is in mode 0, a write here will reset the OUT state */
  953.             if (counter[which].mode == 0)
  954.                 counter_set_out(which, 0);
  955.  
  956.             /* write the LSB */
  957.             if (counter[which].writebyte == 0)
  958.             {
  959.                 counter[which].count = (counter[which].count & 0xff00) | (data & 0x00ff);
  960.                 counter[which].initial = (counter[which].initial & 0xff00) | (data & 0x00ff);
  961.                 counter[which].writebyte = 1;
  962.             }
  963.  
  964.             /* write the MSB and reset the counter */
  965.             else
  966.             {
  967.                 counter[which].count = (counter[which].count & 0x00ff) | ((data << 8) & 0xff00);
  968.                 counter[which].initial = (counter[which].initial & 0x00ff) | ((data << 8) & 0xff00);
  969.                 counter[which].writebyte = 0;
  970.  
  971.                 /* treat 0 as $10000 */
  972.                 if (counter[which].count == 0) counter[which].count = counter[which].initial = 0x10000;
  973.  
  974.                 /* remove any old timer and set a new one */
  975.                 counter_stop(which);
  976.  
  977.                 /* note that in mode 1, we have to wait for a rising edge of a gate */
  978.                 if (counter[which].mode == 0)
  979.                     counter_start(which);
  980.  
  981.                 /* if the counter is in mode 1, a write here will set the OUT state */
  982.                 if (counter[which].mode == 1)
  983.                     counter_set_out(which, 1);
  984.             }
  985.             break;
  986.  
  987.         case 3:
  988.             /* determine which counter */
  989.             which = data >> 6;
  990.             if (which == 3) break;
  991.  
  992.             /* if the counter was in mode 0, a write here will reset the OUT state */
  993.             if (((counter[which].mode >> 1) & 7) == 0)
  994.                 counter_set_out(which, 0);
  995.  
  996.             /* set the mode */
  997.             counter[which].mode = (data >> 1) & 7;
  998.  
  999.             /* if the counter is in mode 0, a write here will reset the OUT state */
  1000.             if (counter[which].mode == 0)
  1001.                 counter_set_out(which, 0);
  1002.             break;
  1003.     }
  1004. }
  1005.  
  1006.  
  1007.  
  1008. /*************************************
  1009.  *
  1010.  *    Sound CPU counter 0 emulation
  1011.  *
  1012.  *************************************/
  1013.  
  1014. static void set_counter_0_ff(int newstate)
  1015. {
  1016.     /* the flip/flop output is inverted, so if we went high to low, that's a clock */
  1017.     if (counter_0_ff && !newstate)
  1018.     {
  1019.         /* only count if gated and non-zero */
  1020.         if (counter[0].count > 0 && counter[0].gate)
  1021.         {
  1022.             counter[0].count--;
  1023.             if (counter[0].count == 0)
  1024.                 counter_callback(0);
  1025.         }
  1026.     }
  1027.  
  1028.     /* remember the new state */
  1029.     counter_0_ff = newstate;
  1030. }
  1031.  
  1032.  
  1033. static void clock_counter_0_ff(int param)
  1034. {
  1035.     /* clock the D value through the flip-flop */
  1036.     set_counter_0_ff((counter_control >> 3) & 1);
  1037. }
  1038.  
  1039.  
  1040. static void update_counter_0_timer(void)
  1041. {
  1042.     double maxfreq = 0.0;
  1043.     int i;
  1044.  
  1045.     /* if there's already a timer, remove it */
  1046.     if (counter_0_timer)
  1047.         timer_remove(counter_0_timer);
  1048.     counter_0_timer = NULL;
  1049.  
  1050.     /* find the counter with the maximum frequency */
  1051.     /* this is used to calibrate the timers at startup */
  1052.     for (i = 0; i < 6; i++)
  1053.         if (cem3394_get_parameter(i, CEM3394_FINAL_GAIN) < 10.0)
  1054.         {
  1055.             double tempfreq;
  1056.  
  1057.             /* if the filter resonance is high, then they're calibrating the filter frequency */
  1058.             if (cem3394_get_parameter(i, CEM3394_FILTER_RESONANCE) > 0.9)
  1059.                 tempfreq = cem3394_get_parameter(i, CEM3394_FILTER_FREQENCY);
  1060.  
  1061.             /* otherwise, they're calibrating the VCO frequency */
  1062.             else
  1063.                 tempfreq = cem3394_get_parameter(i, CEM3394_VCO_FREQUENCY);
  1064.  
  1065.             if (tempfreq > maxfreq) maxfreq = tempfreq;
  1066.         }
  1067.  
  1068.     /* reprime the timer */
  1069.     if (maxfreq > 0.0)
  1070.         counter_0_timer = timer_pulse(TIME_IN_HZ(maxfreq), 0, clock_counter_0_ff);
  1071. }
  1072.  
  1073.  
  1074.  
  1075. /*************************************
  1076.  *
  1077.  *    Sound CPU counter handlers
  1078.  *
  1079.  *************************************/
  1080.  
  1081. static READ_HANDLER( counter_state_r )
  1082. {
  1083.     /* bit D0 is the inverse of the flip-flop state */
  1084.     int result = !counter_0_ff;
  1085.  
  1086.     /* bit D1 is the OUT value from counter 0 */
  1087.     if (counter[0].out) result |= 0x02;
  1088.  
  1089.     return result;
  1090. }
  1091.  
  1092.  
  1093. static WRITE_HANDLER( counter_control_w )
  1094. {
  1095.     UINT8 diff_counter_control = counter_control ^ data;
  1096.  
  1097.     /* set the new global value */
  1098.     counter_control = data;
  1099.  
  1100.     /* bit D0 enables/disables audio */
  1101.     if (diff_counter_control & 0x01)
  1102.     {
  1103.         int ch;
  1104.         for (ch = 0; ch < MIXER_MAX_CHANNELS; ch++)
  1105.         {
  1106.             const char *name = mixer_get_name(ch);
  1107.             if (name && strstr(name, "3394"))
  1108.                 mixer_set_volume(ch, (data & 0x01) ? 100 : 0);
  1109.         }
  1110.     }
  1111.  
  1112.     /* bit D1 is hooked to counter 0's gate */
  1113.     /* if we gate on, start a pulsing timer to clock it */
  1114.     if (!counter[0].gate && (data & 0x02) && !counter_0_timer)
  1115.     {
  1116.         update_counter_0_timer();
  1117.     }
  1118.  
  1119.     /* if we gate off, remove the timer */
  1120.     else if (counter[0].gate && !(data & 0x02) && counter_0_timer)
  1121.     {
  1122.         timer_remove(counter_0_timer);
  1123.         counter_0_timer = NULL;
  1124.     }
  1125.  
  1126.     /* set the actual gate afterwards, since we need to know the old value above */
  1127.     counter_set_gate(0, (data >> 1) & 1);
  1128.  
  1129.     /* bits D2 and D4 control the clear/reset flags on the flip-flop that feeds counter 0 */
  1130.     if (!(data & 0x04)) set_counter_0_ff(1);
  1131.     if (!(data & 0x10)) set_counter_0_ff(0);
  1132.  
  1133.     /* bit 5 clears the NMI interrupt; recompute the I/O state now */
  1134.     m6850_update_io();
  1135. }
  1136.  
  1137.  
  1138.  
  1139. /*************************************
  1140.  *
  1141.  *    Game-specific handlers
  1142.  *
  1143.  *************************************/
  1144.  
  1145. static READ_HANDLER( nstocker_port2_r )
  1146. {
  1147.     return (input_port_2_r(offset) & 0xf0) | nstocker_bits;
  1148. }
  1149.  
  1150.  
  1151. static WRITE_HANDLER( spiker_expand_w )
  1152. {
  1153.     /* offset 0 is the bit pattern */
  1154.     if (offset == 0)
  1155.         spiker_expand_bits = data;
  1156.  
  1157.     /* offset 1 is the background color (cleared on each read) */
  1158.     else if (offset == 1)
  1159.         spiker_expand_bgcolor = data;
  1160.  
  1161.     /* offset 2 is the color */
  1162.     else if (offset == 2)
  1163.         spiker_expand_color = data;
  1164. }
  1165.  
  1166.  
  1167. static READ_HANDLER( spiker_expand_r )
  1168. {
  1169.     UINT8 left, right;
  1170.  
  1171.     /* first rotate each nibble */
  1172.     spiker_expand_bits = ((spiker_expand_bits << 1) & 0xee) | ((spiker_expand_bits >> 3) & 0x11);
  1173.  
  1174.     /* compute left and right pixels */
  1175.     left  = (spiker_expand_bits & 0x10) ? spiker_expand_color : spiker_expand_bgcolor;
  1176.     right = (spiker_expand_bits & 0x01) ? spiker_expand_color : spiker_expand_bgcolor;
  1177.  
  1178.     /* reset the background color */
  1179.     spiker_expand_bgcolor = 0;
  1180.  
  1181.     /* return the combined result */
  1182.     return (left & 0xf0) | (right & 0x0f);
  1183. }
  1184.  
  1185.  
  1186.  
  1187. /*************************************
  1188.  *
  1189.  *    CEM3394 Interfaces
  1190.  *
  1191.  *************************************/
  1192.  
  1193. static WRITE_HANDLER( chip_select_w )
  1194. {
  1195.     static const UINT8 register_map[8] =
  1196.     {
  1197.         CEM3394_VCO_FREQUENCY,
  1198.         CEM3394_FINAL_GAIN,
  1199.         CEM3394_FILTER_RESONANCE,
  1200.         CEM3394_FILTER_FREQENCY,
  1201.         CEM3394_MIXER_BALANCE,
  1202.         CEM3394_MODULATION_AMOUNT,
  1203.         CEM3394_PULSE_WIDTH,
  1204.         CEM3394_WAVE_SELECT
  1205.     };
  1206.  
  1207.     static const char *names[] =
  1208.     {
  1209.         "VCO_FREQUENCY",
  1210.         "FINAL_GAIN",
  1211.         "FILTER_RESONANCE",
  1212.         "FILTER_FREQENCY",
  1213.         "MIXER_BALANCE",
  1214.         "MODULATION_AMOUNT",
  1215.         "PULSE_WIDTH",
  1216.         "WAVE_SELECT"
  1217.     };
  1218.  
  1219.     double voltage = (double)dac_value * (8.0 / 4096.0) - 4.0;
  1220.     int diffchip = data ^ chip_select, i;
  1221.     int reg = register_map[dac_register];
  1222.  
  1223.     /* remember the new select value */
  1224.     chip_select = data;
  1225.  
  1226.     /* check all six chip enables */
  1227.     for (i = 0; i < 6; i++)
  1228.         if ((diffchip & (1 << i)) && (data & (1 << i)))
  1229.         {
  1230.             double temp = 0;
  1231.  
  1232.             /* remember the previous value */
  1233.             temp = cem3394_get_parameter(i, reg);
  1234.  
  1235.             /* set the voltage */
  1236.             cem3394_set_voltage(i, reg, voltage);
  1237.  
  1238.             /* only log changes */
  1239.             if (temp != cem3394_get_parameter(i, reg))
  1240.                 logerror("s%04X:   CEM#%d:%s=%f\n", cpu_getpreviouspc(), i, names[dac_register], voltage);
  1241.         }
  1242.  
  1243.     /* if a timer for counter 0 is running, recompute */
  1244.     if (counter_0_timer)
  1245.         update_counter_0_timer();
  1246. }
  1247.  
  1248.  
  1249.  
  1250. static WRITE_HANDLER( dac_data_w )
  1251. {
  1252.     /* LSB or MSB? */
  1253.     if (offset & 1)
  1254.         dac_value = (dac_value & 0xfc0) | ((data >> 2) & 0x03f);
  1255.     else
  1256.         dac_value = (dac_value & 0x03f) | ((data << 6) & 0xfc0);
  1257.  
  1258.     /* if there are open channels, force the values in */
  1259.     if ((chip_select & 0x3f) != 0x3f)
  1260.     {
  1261.         UINT8 temp = chip_select;
  1262.         chip_select_w(0, 0x3f);
  1263.         chip_select_w(0, temp);
  1264.     }
  1265. }
  1266.  
  1267.  
  1268. static WRITE_HANDLER( register_addr_w )
  1269. {
  1270.     dac_register = data & 7;
  1271. }
  1272.  
  1273.  
  1274.  
  1275. /*************************************
  1276.  *
  1277.  *    Main CPU memory handlers
  1278.  *
  1279.  *************************************/
  1280.  
  1281. /* CPU 1 read addresses */
  1282. static struct MemoryReadAddress readmem_cpu1[] =
  1283. {
  1284.     { 0x0000, 0x8fff, MRA_RAM },
  1285.     { 0x9400, 0x9400, adc_data_r },
  1286.     { 0x9900, 0x9900, input_port_0_r },
  1287.     { 0x9901, 0x9901, input_port_1_r },
  1288.     { 0x9902, 0x9902, input_port_2_r },
  1289.     { 0x9903, 0x9903, input_port_3_r },
  1290.     { 0x9a00, 0x9a03, random_num_r },
  1291.     { 0x9a04, 0x9a05, m6850_r },
  1292.     { 0x9b00, 0x9bff, MRA_RAM },        /* system NOVRAM */
  1293.     { 0x9c00, 0x9cff, MRA_RAM },        /* cart NOVRAM */
  1294.     { 0xa000, 0xbfff, MRA_BANK1 },
  1295.     { 0xc000, 0xffff, MRA_BANK2 },
  1296.     { -1 }  /* end of table */
  1297. };
  1298.  
  1299.  
  1300. /* CPU 1 write addresses */
  1301. static struct MemoryWriteAddress writemem_cpu1[] =
  1302. {
  1303.     { 0x0000, 0x07ff, MWA_RAM, &spriteram },
  1304.     { 0x0800, 0x7fff, balsente_videoram_w, &videoram, &videoram_size },
  1305.     { 0x8000, 0x8fff, balsente_paletteram_w, &paletteram },
  1306.     { 0x9000, 0x9007, adc_select_w },
  1307.     { 0x9800, 0x987f, misc_output_w },
  1308.     { 0x9880, 0x989f, random_reset_w },
  1309.     { 0x98a0, 0x98bf, rombank_select_w },
  1310.     { 0x98c0, 0x98df, balsente_palette_select_w },
  1311.     { 0x98e0, 0x98ff, watchdog_reset_w },
  1312.     { 0x9903, 0x9903, MWA_NOP },
  1313.     { 0x9a04, 0x9a05, m6850_w },
  1314.     { 0x9b00, 0x9cff, MWA_RAM, &nvram, &nvram_size },        /* system NOVRAM + cart NOVRAM */
  1315.     { 0x9f00, 0x9f00, rombank2_select_w },
  1316.     { 0xa000, 0xffff, MWA_ROM },
  1317.     { -1 }  /* end of table */
  1318. };
  1319.  
  1320.  
  1321.  
  1322. /*************************************
  1323.  *
  1324.  *    Sound CPU memory handlers
  1325.  *
  1326.  *************************************/
  1327.  
  1328. static struct MemoryReadAddress readmem_cpu2[] =
  1329. {
  1330.     { 0x0000, 0x1fff, MRA_ROM },
  1331.     { 0x2000, 0x5fff, MRA_RAM },
  1332.     { 0xe000, 0xffff, m6850_sound_r },
  1333.     { -1 }  /* end of table */
  1334. };
  1335.  
  1336.  
  1337. static struct MemoryWriteAddress writemem_cpu2[] =
  1338. {
  1339.     { 0x0000, 0x1fff, MWA_ROM },
  1340.     { 0x2000, 0x5fff, MWA_RAM },
  1341.     { 0x6000, 0x7fff, m6850_sound_w },
  1342.     { -1 }  /* end of table */
  1343. };
  1344.  
  1345.  
  1346. static struct IOReadPort readport_cpu2[] =
  1347. {
  1348.     { 0x00, 0x03, counter_8253_r },
  1349.     { 0x08, 0x0f, counter_state_r },
  1350.     { -1 }  /* end of table */
  1351. };
  1352.  
  1353.  
  1354. static struct IOWritePort writeport_cpu2[] =
  1355. {
  1356.     { 0x00, 0x03, counter_8253_w },
  1357.     { 0x08, 0x09, counter_control_w },
  1358.     { 0x0a, 0x0b, dac_data_w },
  1359.     { 0x0c, 0x0d, register_addr_w },
  1360.     { 0x0e, 0x0f, chip_select_w },
  1361.     { -1 }  /* end of table */
  1362. };
  1363.  
  1364.  
  1365.  
  1366. /*************************************
  1367.  *
  1368.  *    Port definitions
  1369.  *
  1370.  *************************************/
  1371.  
  1372. #define UNUSED_ANALOG \
  1373.     PORT_START\
  1374.     PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED )
  1375. #define UNUSED_ANALOG_X2 UNUSED_ANALOG UNUSED_ANALOG
  1376. #define UNUSED_ANALOG_X3 UNUSED_ANALOG_X2 UNUSED_ANALOG
  1377. #define UNUSED_ANALOG_X4 UNUSED_ANALOG_X2 UNUSED_ANALOG_X2
  1378.  
  1379. #define PLAYER1_ANALOG_JOYSTICK \
  1380.     PORT_START\
  1381.     PORT_ANALOG( 0xff, 0, IPT_AD_STICK_Y | IPF_PLAYER1, 100, 20, 0x80, 0x7f )\
  1382.     PORT_START\
  1383.     PORT_ANALOG( 0xff, 0, IPT_AD_STICK_X | IPF_REVERSE | IPF_PLAYER1, 100, 20, 0x80, 0x7f )
  1384.  
  1385. #define PLAYER2_ANALOG_JOYSTICK \
  1386.     PORT_START\
  1387.     PORT_ANALOG( 0xff, 0, IPT_AD_STICK_Y | IPF_PLAYER2, 100, 20, 0x80, 0x7f )\
  1388.     PORT_START\
  1389.     PORT_ANALOG( 0xff, 0, IPT_AD_STICK_X | IPF_REVERSE | IPF_PLAYER2, 100, 20, 0x80, 0x7f )
  1390.  
  1391. #define PLAYER1_TRACKBALL \
  1392.     PORT_START\
  1393.     PORT_ANALOG( 0xff, 0, IPT_TRACKBALL_Y | IPF_PLAYER1 | IPF_CENTER, 100, 20, 0, 0 )\
  1394.     PORT_START\
  1395.     PORT_ANALOG( 0xff, 0, IPT_TRACKBALL_X | IPF_REVERSE | IPF_PLAYER1 | IPF_CENTER, 100, 20, 0, 0 )
  1396.  
  1397. #define PLAYER2_TRACKBALL \
  1398.     PORT_START\
  1399.     PORT_ANALOG( 0xff, 0, IPT_TRACKBALL_Y | IPF_PLAYER2 | IPF_CENTER, 100, 20, 0, 0 )\
  1400.     PORT_START\
  1401.     PORT_ANALOG( 0xff, 0, IPT_TRACKBALL_X | IPF_REVERSE | IPF_PLAYER2 | IPF_CENTER, 100, 20, 0, 0 )
  1402.  
  1403. #define PLAYER1_DIAL \
  1404.     PORT_START\
  1405.     PORT_ANALOG( 0xff, 0, IPT_DIAL | IPF_PLAYER1 | IPF_REVERSE | IPF_CENTER, 100, 20, 0, 0 )
  1406.  
  1407. #define PLAYER2_DIAL \
  1408.     PORT_START\
  1409.     PORT_ANALOG( 0xff, 0, IPT_DIAL | IPF_PLAYER2 | IPF_REVERSE | IPF_CENTER, 100, 20, 0, 0 )
  1410.  
  1411. #define PLAYER1_WHEEL \
  1412.     PORT_START\
  1413.     PORT_ANALOG( 0xff, 0, IPT_DIAL | IPF_PLAYER1 | IPF_CENTER, 100, 20, 0, 0 )
  1414.  
  1415. #define PLAYER1_CROSSHAIRS \
  1416.     PORT_START                /* fake analog X */\
  1417.     PORT_ANALOG( 0xff, 0x80, IPT_AD_STICK_X, 50, 10, 0, 255 )\
  1418.     PORT_START                /* fake analog Y */\
  1419.     PORT_ANALOG( 0xff, 0x80, IPT_AD_STICK_Y, 70, 10, 0, 255 )
  1420.  
  1421.  
  1422. INPUT_PORTS_START( sentetst )
  1423.     PORT_START    /* IN0 */
  1424.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ))
  1425.     PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ))
  1426.     PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ))
  1427.     PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ))
  1428.     PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ))
  1429.     PORT_BIT( 0x7c, IP_ACTIVE_LOW, IPT_UNUSED )
  1430.     PORT_DIPNAME( 0x80, 0x80, "High Scores" )
  1431.     PORT_DIPSETTING(    0x80, "Keep Top 5" )
  1432.     PORT_DIPSETTING(    0x00, "Keep All" )
  1433.  
  1434.     PORT_START    /* IN1 */
  1435.     PORT_DIPNAME( 0x03, 0x00, DEF_STR( Bonus_Life ))
  1436.     PORT_DIPSETTING(    0x00, "Every 10,000" )
  1437.     PORT_DIPSETTING(    0x01, "Every 15,000" )
  1438.     PORT_DIPSETTING(    0x02, "Every 20,000" )
  1439.     PORT_DIPSETTING(    0x03, "Every 25,000" )
  1440.     PORT_DIPNAME( 0x0c, 0x08, DEF_STR( Lives ))
  1441.     PORT_DIPSETTING(    0x00, "2" )
  1442.     PORT_DIPSETTING(    0x04, "3" )
  1443.     PORT_DIPSETTING(    0x08, "4" )
  1444.     PORT_DIPSETTING(    0x0c, "5" )
  1445.     PORT_BIT( 0x30, IP_ACTIVE_LOW, IPT_UNUSED )
  1446.     PORT_DIPNAME( 0x40, 0x40, DEF_STR( Difficulty ))
  1447.     PORT_DIPSETTING(    0x40, "Easy" )
  1448.     PORT_DIPSETTING(    0x00, "Hard" )
  1449.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ))
  1450.     PORT_DIPSETTING(    0x80, DEF_STR( Off ))
  1451.     PORT_DIPSETTING(    0x00, DEF_STR( On ))
  1452.  
  1453.     PORT_START    /* IN2 */
  1454.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP | IPF_PLAYER1 )
  1455.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN | IPF_PLAYER1 )
  1456.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT | IPF_PLAYER1 )
  1457.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT | IPF_PLAYER1 )
  1458.     PORT_BIT( 0x30, IP_ACTIVE_LOW, IPT_UNUSED )
  1459.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
  1460.     PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
  1461.  
  1462.     PORT_START    /* IN3 */
  1463.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
  1464.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
  1465.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 )
  1466.     PORT_BIT( 0x38, IP_ACTIVE_LOW, IPT_UNUSED )
  1467.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
  1468.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
  1469.  
  1470.     /* analog ports */
  1471.     UNUSED_ANALOG_X2
  1472.     PLAYER1_TRACKBALL
  1473. INPUT_PORTS_END
  1474.  
  1475.  
  1476. INPUT_PORTS_START( cshift )
  1477.     PORT_START    /* IN0 */
  1478.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ))
  1479.     PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ))
  1480.     PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ))
  1481.     PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ))
  1482.     PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ))
  1483.     PORT_BIT( 0x7c, IP_ACTIVE_LOW, IPT_UNUSED )
  1484.     PORT_DIPNAME( 0x80, 0x80, "High Scores" )
  1485.     PORT_DIPSETTING(    0x80, "Keep Top 5" )
  1486.     PORT_DIPSETTING(    0x00, "Keep All" )
  1487.  
  1488.     PORT_START    /* IN1 */
  1489.     PORT_BIT( 0x03, IP_ACTIVE_LOW, IPT_UNUSED )
  1490.     PORT_DIPNAME( 0x04, 0x00, DEF_STR( Lives ))
  1491.     PORT_DIPSETTING(    0x00, "2" )
  1492.     PORT_DIPSETTING(    0x04, "3" )
  1493.     PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_UNUSED )
  1494.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ))
  1495.     PORT_DIPSETTING(    0x80, DEF_STR( Off ))
  1496.     PORT_DIPSETTING(    0x00, DEF_STR( On ))
  1497.  
  1498.     PORT_START    /* IN2 */
  1499.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )
  1500.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
  1501.     PORT_BIT( 0x3c, IP_ACTIVE_LOW, IPT_UNUSED )
  1502.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
  1503.     PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
  1504.  
  1505.     PORT_START    /* IN3 */
  1506.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
  1507.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
  1508.     PORT_BIT( 0x3c, IP_ACTIVE_LOW, IPT_UNUSED )
  1509.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
  1510.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
  1511.  
  1512.     /* analog ports */
  1513.     UNUSED_ANALOG_X4
  1514. INPUT_PORTS_END
  1515.  
  1516.  
  1517. INPUT_PORTS_START( gghost )
  1518.     PORT_START    /* IN0 */
  1519.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ))
  1520.     PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ))
  1521.     PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ))
  1522.     PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ))
  1523.     PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ))
  1524.     PORT_DIPNAME( 0x04, 0x04, "Players Per Credit" )
  1525.     PORT_DIPSETTING(    0x00, "1" )
  1526.     PORT_DIPSETTING(    0x04, "1 or 2" )
  1527.     PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED )
  1528.  
  1529.     PORT_START    /* IN1 */
  1530.     PORT_DIPNAME( 0x07, 0x05, "Game Duration" )
  1531.     PORT_DIPSETTING(    0x00, "9 points" )
  1532.     PORT_DIPSETTING(    0x02, "11 points" )
  1533.     PORT_DIPSETTING(    0x04, "15 points" )
  1534.     PORT_DIPSETTING(    0x06, "21 points" )
  1535.     PORT_DIPSETTING(    0x01, "timed, 1:15" )
  1536.     PORT_DIPSETTING(    0x03, "timed, 1:30" )
  1537.     PORT_DIPSETTING(    0x05, "timed, 2:00" )
  1538.     PORT_DIPSETTING(    0x07, "timed, 2:30" )
  1539.     PORT_BIT( 0x78, IP_ACTIVE_HIGH, IPT_UNUSED )
  1540.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ))
  1541.     PORT_DIPSETTING(    0x80, DEF_STR( Off ))
  1542.     PORT_DIPSETTING(    0x00, DEF_STR( On ))
  1543.  
  1544.     PORT_START    /* IN2 */
  1545.     PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNUSED )
  1546.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
  1547.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER2 )
  1548.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
  1549.     PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
  1550.  
  1551.     PORT_START    /* IN3 */
  1552.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
  1553.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
  1554.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER1 )
  1555.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER1 )
  1556.     PORT_BIT( 0x30, IP_ACTIVE_LOW, IPT_UNUSED )
  1557.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
  1558.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
  1559.  
  1560.     /* analog ports */
  1561.     PLAYER2_TRACKBALL
  1562.     PLAYER1_TRACKBALL
  1563. INPUT_PORTS_END
  1564.  
  1565.  
  1566. INPUT_PORTS_START( hattrick )
  1567.     PORT_START    /* IN0 */
  1568.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ))
  1569.     PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ))
  1570.     PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ))
  1571.     PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ))
  1572.     PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ))
  1573.     PORT_DIPNAME( 0x04, 0x04, "Players Per Credit" )
  1574.     PORT_DIPSETTING(    0x00, "1" )
  1575.     PORT_DIPSETTING(    0x04, "1 or 2" )
  1576.     PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED )
  1577.  
  1578.     PORT_START    /* IN1 */
  1579.     PORT_DIPNAME( 0x07, 0x02, "Game Time" )
  1580.     PORT_DIPSETTING(    0x00, "1:15" )
  1581.     PORT_DIPSETTING(    0x01, "1:30" )
  1582.     PORT_DIPSETTING(    0x02, "1:45" )
  1583.     PORT_DIPSETTING(    0x03, "2:00" )
  1584.     PORT_DIPSETTING(    0x04, "2:15" )
  1585.     PORT_DIPSETTING(    0x05, "2:30" )
  1586.     PORT_DIPSETTING(    0x06, "2:45" )
  1587.     PORT_DIPSETTING(    0x07, "3:00" )
  1588.     PORT_BIT( 0x78, IP_ACTIVE_HIGH, IPT_UNUSED )
  1589.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ))
  1590.     PORT_DIPSETTING(    0x80, DEF_STR( Off ))
  1591.     PORT_DIPSETTING(    0x00, DEF_STR( On ))
  1592.  
  1593.     PORT_START    /* IN2 */
  1594.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_PLAYER1 )
  1595.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_PLAYER1 )
  1596.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_PLAYER1 )
  1597.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_PLAYER1 )
  1598.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
  1599.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
  1600.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
  1601.     PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
  1602.  
  1603.     PORT_START    /* IN3 */
  1604.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
  1605.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
  1606.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_PLAYER2 )
  1607.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_PLAYER2 )
  1608.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_PLAYER2 )
  1609.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_PLAYER2 )
  1610.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
  1611.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
  1612.  
  1613.     /* analog ports */
  1614.     UNUSED_ANALOG_X4
  1615. INPUT_PORTS_END
  1616.  
  1617.  
  1618. INPUT_PORTS_START( otwalls )
  1619.     PORT_START    /* IN0 */
  1620.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ))
  1621.     PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ))
  1622.     PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ))
  1623.     PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ))
  1624.     PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ))
  1625.     PORT_DIPNAME( 0x04, 0x04, "Players Per Credit" )
  1626.     PORT_DIPSETTING(    0x00, "1" )
  1627.     PORT_DIPSETTING(    0x04, "1 or 2" )
  1628.     PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNUSED )
  1629.  
  1630.     PORT_START    /* IN1 */
  1631.     PORT_BIT( 0x7f, IP_ACTIVE_LOW, IPT_UNUSED )
  1632.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ))
  1633.     PORT_DIPSETTING(    0x80, DEF_STR( Off ))
  1634.     PORT_DIPSETTING(    0x00, DEF_STR( On ))
  1635.  
  1636.     PORT_START    /* IN2 */
  1637.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT | IPF_PLAYER2 )
  1638.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT | IPF_PLAYER2 )
  1639.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT | IPF_PLAYER1 )
  1640.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT | IPF_PLAYER1 )
  1641.     PORT_BIT( 0x30, IP_ACTIVE_LOW, IPT_UNUSED )
  1642.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
  1643.     PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
  1644.  
  1645.     PORT_START    /* IN3 */
  1646.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
  1647.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
  1648.     PORT_BIT( 0x3c, IP_ACTIVE_LOW, IPT_UNUSED )
  1649.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
  1650.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
  1651.  
  1652.     /* analog ports */
  1653.     UNUSED_ANALOG_X2
  1654.     PLAYER1_DIAL
  1655.     PLAYER2_DIAL
  1656. INPUT_PORTS_END
  1657.  
  1658.  
  1659. INPUT_PORTS_START( snakepit )
  1660.     PORT_START    /* IN0 */
  1661.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ))
  1662.     PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ))
  1663.     PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ))
  1664.     PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ))
  1665.     PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ))
  1666.     PORT_BIT( 0x7c, IP_ACTIVE_LOW, IPT_UNUSED )
  1667.     PORT_DIPNAME( 0x80, 0x80, "High Scores" )
  1668.     PORT_DIPSETTING(    0x80, "Keep Top 5" )
  1669.     PORT_DIPSETTING(    0x00, "Keep All" )
  1670.  
  1671.     PORT_START    /* IN1 */
  1672.     PORT_DIPNAME( 0x03, 0x00, DEF_STR( Bonus_Life ))
  1673.     PORT_DIPSETTING(    0x00, "Every 10,000" )
  1674.     PORT_DIPSETTING(    0x01, "Every 15,000" )
  1675.     PORT_DIPSETTING(    0x02, "Every 20,000" )
  1676.     PORT_DIPSETTING(    0x03, "Every 25,000" )
  1677.     PORT_DIPNAME( 0x0c, 0x08, DEF_STR( Lives ))
  1678.     PORT_DIPSETTING(    0x00, "2" )
  1679.     PORT_DIPSETTING(    0x04, "3" )
  1680.     PORT_DIPSETTING(    0x08, "4" )
  1681.     PORT_DIPSETTING(    0x0c, "5" )
  1682.     PORT_BIT( 0x30, IP_ACTIVE_LOW, IPT_UNUSED )
  1683.     PORT_DIPNAME( 0x40, 0x40, DEF_STR( Difficulty ))
  1684.     PORT_DIPSETTING(    0x40, "Easy" )
  1685.     PORT_DIPSETTING(    0x00, "Hard" )
  1686.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ))
  1687.     PORT_DIPSETTING(    0x80, DEF_STR( Off ))
  1688.     PORT_DIPSETTING(    0x00, DEF_STR( On ))
  1689.  
  1690.     PORT_START    /* IN2 */
  1691.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP | IPF_PLAYER1 )
  1692.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN | IPF_PLAYER1 )
  1693.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT | IPF_PLAYER1 )
  1694.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT | IPF_PLAYER1 )
  1695.     PORT_BIT( 0x30, IP_ACTIVE_LOW, IPT_UNUSED )
  1696.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
  1697.     PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
  1698.  
  1699.     PORT_START    /* IN3 */
  1700.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
  1701.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
  1702.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 )
  1703.     PORT_BIT( 0x38, IP_ACTIVE_LOW, IPT_UNUSED )
  1704.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
  1705.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
  1706.  
  1707.     /* analog ports */
  1708.     UNUSED_ANALOG_X2
  1709.     PLAYER1_TRACKBALL
  1710. INPUT_PORTS_END
  1711.  
  1712.  
  1713. INPUT_PORTS_START( snakjack )
  1714.     PORT_START    /* IN0 */
  1715.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ))
  1716.     PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ))
  1717.     PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ))
  1718.     PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ))
  1719.     PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ))
  1720.     PORT_BIT( 0x7c, IP_ACTIVE_LOW, IPT_UNUSED )
  1721.     PORT_DIPNAME( 0x80, 0x80, "High Scores" )
  1722.     PORT_DIPSETTING(    0x80, "Keep Top 5" )
  1723.     PORT_DIPSETTING(    0x00, "Keep All" )
  1724.  
  1725.     PORT_START    /* IN1 */
  1726.     PORT_DIPNAME( 0x03, 0x01, DEF_STR( Bonus_Life ))
  1727.     PORT_DIPSETTING(    0x00, "Every 15,000" )
  1728.     PORT_DIPSETTING(    0x01, "Every 20,000" )
  1729.     PORT_DIPSETTING(    0x02, "Every 25,000" )
  1730.     PORT_DIPSETTING(    0x03, "Every 30,000" )
  1731.     PORT_DIPNAME( 0x0c, 0x04, DEF_STR( Lives ))
  1732.     PORT_DIPSETTING(    0x00, "2" )
  1733.     PORT_DIPSETTING(    0x04, "3" )
  1734.     PORT_DIPSETTING(    0x08, "4" )
  1735.     PORT_DIPSETTING(    0x0c, "5" )
  1736.     PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_UNUSED )
  1737.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ))
  1738.     PORT_DIPSETTING(    0x80, DEF_STR( Off ))
  1739.     PORT_DIPSETTING(    0x00, DEF_STR( On ))
  1740.  
  1741.     PORT_START    /* IN2 */
  1742.     PORT_BIT( 0x3f, IP_ACTIVE_LOW, IPT_UNUSED )
  1743.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
  1744.     PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
  1745.  
  1746.     PORT_START    /* IN3 */
  1747.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
  1748.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
  1749.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 )
  1750.     PORT_BIT( 0x38, IP_ACTIVE_LOW, IPT_UNUSED )
  1751.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
  1752.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
  1753.  
  1754.     /* analog ports */
  1755.     UNUSED_ANALOG_X2
  1756.     PLAYER1_TRACKBALL
  1757. INPUT_PORTS_END
  1758.  
  1759.  
  1760. INPUT_PORTS_START( stocker )
  1761.     PORT_START    /* IN0 */
  1762.     PORT_DIPNAME( 0x03, 0x01, DEF_STR( Coinage ))
  1763.     PORT_DIPSETTING(    0x03, DEF_STR( 2C_1C ))
  1764.     PORT_DIPSETTING(    0x01, DEF_STR( 1C_1C ))
  1765.     PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ))
  1766.     PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ))
  1767.     PORT_DIPNAME( 0x1c, 0x00, "Bonus Coins" )
  1768.     PORT_DIPSETTING(    0x00, "None" )
  1769.     PORT_DIPSETTING(    0x04, "2 Coins = 1 Bonus" )
  1770.     PORT_DIPSETTING(    0x08, "3 Coins = 1 Bonus" )
  1771.     PORT_DIPSETTING(    0x0c, "4 Coins = 1 Bonus" )
  1772.     PORT_DIPSETTING(    0x10, "4 Coins = 2 Bonus" )
  1773.     PORT_DIPSETTING(    0x14, "5 Coins = 1 Bonus" )
  1774.     PORT_DIPSETTING(    0x18, "5 Coins = 2 Bonus" )
  1775.     PORT_DIPSETTING(    0x1c, "5 Coins = 3 Bonus" )
  1776.     PORT_DIPNAME( 0x20, 0x00, "Left Coin Mech" )
  1777.     PORT_DIPSETTING(    0x00, "x1" )
  1778.     PORT_DIPSETTING(    0x20, "x2" )
  1779.     PORT_DIPNAME( 0xc0, 0x00, "Right Coin Mech" )
  1780.     PORT_DIPSETTING(    0x00, "x1" )
  1781.     PORT_DIPSETTING(    0x40, "x4" )
  1782.     PORT_DIPSETTING(    0x80, "x5" )
  1783.     PORT_DIPSETTING(    0xc0, "x6" )
  1784.  
  1785.     PORT_START    /* IN1 */
  1786.     PORT_BIT( 0x3f, IP_ACTIVE_LOW, IPT_UNUSED )
  1787.     PORT_DIPNAME( 0x40, 0x40, "End of Game" )
  1788.     PORT_DIPSETTING(    0x40, "Normal" )
  1789.     PORT_DIPSETTING(    0x00, "3 Tickets" )
  1790.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ))
  1791.     PORT_DIPSETTING(    0x80, DEF_STR( Off ))
  1792.     PORT_DIPSETTING(    0x00, DEF_STR( On ))
  1793.  
  1794.     PORT_START    /* IN2 */
  1795.     PORT_BIT( 0x3f, IP_ACTIVE_LOW, IPT_UNUSED )
  1796.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
  1797.     PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
  1798.  
  1799.     PORT_START    /* IN3 */
  1800.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
  1801.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 )
  1802.     PORT_BIT( 0x3c, IP_ACTIVE_LOW, IPT_UNUSED )
  1803.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
  1804.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
  1805.  
  1806.     /* analog ports */
  1807.     UNUSED_ANALOG_X3
  1808.     PLAYER1_WHEEL
  1809. INPUT_PORTS_END
  1810.  
  1811.  
  1812. INPUT_PORTS_START( triviag1 )
  1813.     PORT_START    /* IN0 */
  1814.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ))
  1815.     PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ))
  1816.     PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ))
  1817.     PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ))
  1818.     PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ))
  1819.     PORT_BIT( 0x1c, IP_ACTIVE_LOW, IPT_UNUSED )
  1820.     PORT_DIPNAME( 0x20, 0x00, "Sound" )
  1821.     PORT_DIPSETTING(    0x20, DEF_STR( Off ))
  1822.     PORT_DIPSETTING(    0x00, DEF_STR( On ))
  1823.     PORT_DIPNAME( 0x40, 0x00, "Sound Test" )
  1824.     PORT_DIPSETTING(    0x40, DEF_STR( Off ))
  1825.     PORT_DIPSETTING(    0x00, DEF_STR( On ))
  1826.     PORT_DIPNAME( 0x80, 0x80, "High Scores" )
  1827.     PORT_DIPSETTING(    0x00, "Keep Top 5" )
  1828.     PORT_DIPSETTING(    0x80, "Keep Top 10" )
  1829.  
  1830.     PORT_START    /* IN1 */
  1831.     PORT_BIT( 0x03, IP_ACTIVE_LOW, IPT_UNUSED )
  1832.     PORT_DIPNAME( 0x0c, 0x04, "Guesses" )
  1833.     PORT_DIPSETTING(    0x00, "3" )
  1834.     PORT_DIPSETTING(    0x04, "4" )
  1835.     PORT_DIPSETTING(    0x08, "5" )
  1836.     PORT_DIPSETTING(    0x0c, "6" )
  1837.     PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_UNUSED )
  1838.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ))
  1839.     PORT_DIPSETTING(    0x80, DEF_STR( Off ))
  1840.     PORT_DIPSETTING(    0x00, DEF_STR( On ))
  1841.  
  1842.     PORT_START    /* IN2 */
  1843.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_PLAYER1 )
  1844.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_PLAYER1 )
  1845.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_PLAYER1 )
  1846.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_PLAYER1 )
  1847.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
  1848.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
  1849.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
  1850.     PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
  1851.  
  1852.     PORT_START    /* IN3 */
  1853.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
  1854.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
  1855.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START3 )
  1856.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START4 )
  1857.     PORT_BITX(0x10, IP_ACTIVE_LOW, IPT_BUTTON2, "Red Button", IP_KEY_DEFAULT, IP_JOY_DEFAULT )
  1858.     PORT_BITX(0x20, IP_ACTIVE_LOW, IPT_BUTTON1, "Green Button", IP_KEY_DEFAULT, IP_JOY_DEFAULT )
  1859.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
  1860.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
  1861.  
  1862.     /* analog ports */
  1863.     UNUSED_ANALOG_X4
  1864. INPUT_PORTS_END
  1865.  
  1866.  
  1867. #define input_ports_triviag2 input_ports_triviag1
  1868. #define input_ports_triviasp input_ports_triviag1
  1869. #define input_ports_triviayp input_ports_triviag1
  1870. #define input_ports_triviabb input_ports_triviag1
  1871.  
  1872.  
  1873. INPUT_PORTS_START( gimeabrk )
  1874.     PORT_START    /* IN0 */
  1875.     PORT_DIPNAME( 0x03, 0x01, DEF_STR( Coinage ))
  1876.     PORT_DIPSETTING(    0x03, DEF_STR( 2C_1C ))
  1877.     PORT_DIPSETTING(    0x01, DEF_STR( 1C_1C ))
  1878.     PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ))
  1879.     PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ))
  1880.     PORT_DIPNAME( 0x1c, 0x00, "Bonus Coins" )
  1881.     PORT_DIPSETTING(    0x00, "None" )
  1882.     PORT_DIPSETTING(    0x04, "2 Coins = 1 Bonus" )
  1883.     PORT_DIPSETTING(    0x08, "3 Coins = 1 Bonus" )
  1884.     PORT_DIPSETTING(    0x0c, "4 Coins = 1 Bonus" )
  1885.     PORT_DIPSETTING(    0x10, "4 Coins = 2 Bonus" )
  1886.     PORT_DIPSETTING(    0x14, "5 Coins = 1 Bonus" )
  1887.     PORT_DIPSETTING(    0x18, "5 Coins = 2 Bonus" )
  1888.     PORT_DIPSETTING(    0x1c, "5 Coins = 3 Bonus" )
  1889.     PORT_DIPNAME( 0x20, 0x00, "Left Coin Mech" )
  1890.     PORT_DIPSETTING(    0x00, "x1" )
  1891.     PORT_DIPSETTING(    0x20, "x2" )
  1892.     PORT_DIPNAME( 0xc0, 0x00, "Right Coin Mech" )
  1893.     PORT_DIPSETTING(    0x00, "x1" )
  1894.     PORT_DIPSETTING(    0x40, "x4" )
  1895.     PORT_DIPSETTING(    0x80, "x5" )
  1896.     PORT_DIPSETTING(    0xc0, "x6" )
  1897.  
  1898.     PORT_START    /* IN1 */
  1899.     PORT_DIPNAME( 0x03, 0x01, "Bonus Shot" )
  1900.     PORT_DIPSETTING(    0x00, "Every 6 Balls" )
  1901.     PORT_DIPSETTING(    0x01, "Every 8 Balls" )
  1902.     PORT_DIPSETTING(    0x02, "Every 10 Balls" )
  1903.     PORT_DIPSETTING(    0x03, "Every 12 Balls" )
  1904.     PORT_DIPNAME( 0x0c, 0x08, "Initial Shots" )
  1905.     PORT_DIPSETTING(    0x00, "8" )
  1906.     PORT_DIPSETTING(    0x04, "10" )
  1907.     PORT_DIPSETTING(    0x08, "12" )
  1908.     PORT_DIPSETTING(    0x0c, "14" )
  1909.     PORT_DIPNAME( 0x10, 0x00, "Players Per Credit" )
  1910.     PORT_DIPSETTING(    0x00, "1" )
  1911.     PORT_DIPSETTING(    0x10, "1 or 2" )
  1912.     PORT_DIPNAME( 0x20, 0x20, DEF_STR( Cabinet ))
  1913.     PORT_DIPSETTING(    0x20, DEF_STR( Upright ))
  1914.     PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ))
  1915.     PORT_DIPNAME( 0x40, 0x40, "High Scores" )
  1916.     PORT_DIPSETTING(    0x40, "Keep Top 5" )
  1917.     PORT_DIPSETTING(    0x00, "Keep All" )
  1918.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ))
  1919.     PORT_DIPSETTING(    0x80, DEF_STR( Off ))
  1920.     PORT_DIPSETTING(    0x00, DEF_STR( On ))
  1921.  
  1922.     PORT_START    /* IN2 */
  1923.     PORT_BIT( 0x3f, IP_ACTIVE_LOW, IPT_UNUSED )
  1924.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
  1925.     PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
  1926.  
  1927.     PORT_START    /* IN3 */
  1928.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
  1929.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
  1930.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
  1931.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
  1932.     PORT_BIT( 0x30, IP_ACTIVE_LOW, IPT_UNUSED )
  1933.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
  1934.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
  1935.  
  1936.     /* analog ports */
  1937.     PLAYER1_TRACKBALL
  1938.     UNUSED_ANALOG_X2
  1939. INPUT_PORTS_END
  1940.  
  1941.  
  1942. INPUT_PORTS_START( minigolf )
  1943.     PORT_START    /* IN0 */
  1944.     PORT_DIPNAME( 0x03, 0x01, DEF_STR( Coinage ))
  1945.     PORT_DIPSETTING(    0x03, DEF_STR( 2C_1C ))
  1946.     PORT_DIPSETTING(    0x01, DEF_STR( 1C_1C ))
  1947.     PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ))
  1948.     PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ))
  1949.     PORT_DIPNAME( 0x1c, 0x00, "Bonus Coins" )
  1950.     PORT_DIPSETTING(    0x00, "None" )
  1951.     PORT_DIPSETTING(    0x04, "2 Coins = 1 Bonus" )
  1952.     PORT_DIPSETTING(    0x08, "3 Coins = 1 Bonus" )
  1953.     PORT_DIPSETTING(    0x0c, "4 Coins = 1 Bonus" )
  1954.     PORT_DIPSETTING(    0x10, "4 Coins = 2 Bonus" )
  1955.     PORT_DIPSETTING(    0x14, "5 Coins = 1 Bonus" )
  1956.     PORT_DIPSETTING(    0x18, "5 Coins = 2 Bonus" )
  1957.     PORT_DIPSETTING(    0x1c, "5 Coins = 3 Bonus" )
  1958.     PORT_DIPNAME( 0x20, 0x00, "Left Coin Mech" )
  1959.     PORT_DIPSETTING(    0x00, "x1" )
  1960.     PORT_DIPSETTING(    0x20, "x2" )
  1961.     PORT_DIPNAME( 0xc0, 0x00, "Right Coin Mech" )
  1962.     PORT_DIPSETTING(    0x00, "x1" )
  1963.     PORT_DIPSETTING(    0x40, "x4" )
  1964.     PORT_DIPSETTING(    0x80, "x5" )
  1965.     PORT_DIPSETTING(    0xc0, "x6" )
  1966.  
  1967.     PORT_START    /* IN1 */
  1968.     PORT_DIPNAME( 0x01, 0x01, "Add-A-Coin" )
  1969.     PORT_DIPSETTING(    0x01, DEF_STR( Off ))
  1970.     PORT_DIPSETTING(    0x00, DEF_STR( On ))
  1971.     PORT_BIT( 0x7e, IP_ACTIVE_LOW, IPT_BUTTON1 )
  1972.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ))
  1973.     PORT_DIPSETTING(    0x80, DEF_STR( Off ))
  1974.     PORT_DIPSETTING(    0x00, DEF_STR( On ))
  1975.  
  1976.     PORT_START    /* IN2 */
  1977.     PORT_BIT( 0x3f, IP_ACTIVE_LOW, IPT_UNUSED )
  1978.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
  1979.     PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
  1980.  
  1981.     PORT_START    /* IN3 */
  1982.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
  1983.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
  1984.     PORT_BIT( 0x0c, IP_ACTIVE_LOW, IPT_UNUSED )
  1985.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
  1986.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
  1987.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
  1988.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
  1989.  
  1990.     /* analog ports */
  1991.     UNUSED_ANALOG_X2
  1992.     PLAYER1_TRACKBALL
  1993. INPUT_PORTS_END
  1994.  
  1995.  
  1996. INPUT_PORTS_START( minigol2 )
  1997.     PORT_START    /* IN0 */
  1998.     PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ))
  1999.     PORT_DIPSETTING(    0x03, DEF_STR( 3C_1C ))
  2000.     PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ))
  2001.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ))
  2002.     PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ))
  2003.     PORT_DIPNAME( 0x1c, 0x00, "Bonus Coins" )
  2004.     PORT_DIPSETTING(    0x00, "None" )
  2005.     PORT_DIPSETTING(    0x04, "2 Coins = 1 Bonus" )
  2006.     PORT_DIPSETTING(    0x08, "3 Coins = 1 Bonus" )
  2007.     PORT_DIPSETTING(    0x0c, "4 Coins = 1 Bonus" )
  2008.     PORT_DIPSETTING(    0x10, "4 Coins = 2 Bonus" )
  2009.     PORT_DIPSETTING(    0x14, "5 Coins = 1 Bonus" )
  2010.     PORT_DIPSETTING(    0x18, "5 Coins = 2 Bonus" )
  2011.     PORT_DIPSETTING(    0x1c, "5 Coins = 3 Bonus" )
  2012.     PORT_DIPNAME( 0x20, 0x00, "Left Coin Mech" )
  2013.     PORT_DIPSETTING(    0x00, "x1" )
  2014.     PORT_DIPSETTING(    0x20, "x2" )
  2015.     PORT_DIPNAME( 0xc0, 0x00, "Right Coin Mech" )
  2016.     PORT_DIPSETTING(    0x00, "x1" )
  2017.     PORT_DIPSETTING(    0x40, "x4" )
  2018.     PORT_DIPSETTING(    0x80, "x5" )
  2019.     PORT_DIPSETTING(    0xc0, "x6" )
  2020.  
  2021.     PORT_START    /* IN1 */
  2022.     PORT_DIPNAME( 0x01, 0x01, "Add-A-Coin" )
  2023.     PORT_DIPSETTING(    0x01, DEF_STR( Off ))
  2024.     PORT_DIPSETTING(    0x00, DEF_STR( On ))
  2025.     PORT_BIT( 0x7e, IP_ACTIVE_LOW, IPT_BUTTON1 )
  2026.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ))
  2027.     PORT_DIPSETTING(    0x80, DEF_STR( Off ))
  2028.     PORT_DIPSETTING(    0x00, DEF_STR( On ))
  2029.  
  2030.     PORT_START    /* IN2 */
  2031.     PORT_BIT( 0x3f, IP_ACTIVE_LOW, IPT_UNUSED )
  2032.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
  2033.     PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
  2034.  
  2035.     PORT_START    /* IN3 */
  2036.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
  2037.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
  2038.     PORT_BIT( 0x0c, IP_ACTIVE_LOW, IPT_UNUSED )
  2039.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
  2040.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
  2041.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
  2042.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
  2043.  
  2044.     /* analog ports */
  2045.     UNUSED_ANALOG_X2
  2046.     PLAYER1_TRACKBALL
  2047. INPUT_PORTS_END
  2048.  
  2049.  
  2050. INPUT_PORTS_START( toggle )
  2051.     PORT_START    /* IN0 */
  2052.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ))
  2053.     PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ))
  2054.     PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ))
  2055.     PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ))
  2056.     PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ))
  2057.     PORT_BIT( 0x7c, IP_ACTIVE_LOW, IPT_UNUSED )
  2058.     PORT_DIPNAME( 0x80, 0x80, "High Scores" )
  2059.     PORT_DIPSETTING(    0x80, "Keep Top 5" )
  2060.     PORT_DIPSETTING(    0x00, "Keep All" )
  2061.  
  2062.     PORT_START    /* IN1 */
  2063.     PORT_BIT( 0x03, IP_ACTIVE_LOW, IPT_UNUSED )
  2064.     PORT_DIPNAME( 0x04, 0x04, DEF_STR( Lives ))
  2065.     PORT_DIPSETTING(    0x00, "2" )
  2066.     PORT_DIPSETTING(    0x04, "3" )
  2067.     PORT_BIT( 0x78, IP_ACTIVE_LOW, IPT_UNUSED )
  2068.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ))
  2069.     PORT_DIPSETTING(    0x80, DEF_STR( Off ))
  2070.     PORT_DIPSETTING(    0x00, DEF_STR( On ))
  2071.  
  2072.     PORT_START    /* IN2 */
  2073.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_PLAYER1 )
  2074.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_PLAYER1 )
  2075.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_PLAYER1 )
  2076.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_PLAYER1 )
  2077.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
  2078.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
  2079.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
  2080.     PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
  2081.  
  2082.     PORT_START    /* IN3 */
  2083.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
  2084.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
  2085.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_PLAYER2 )
  2086.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_PLAYER2 )
  2087.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_PLAYER2 )
  2088.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_PLAYER2 )
  2089.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
  2090.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
  2091.  
  2092.     /* analog ports */
  2093.     UNUSED_ANALOG_X4
  2094. INPUT_PORTS_END
  2095.  
  2096.  
  2097. INPUT_PORTS_START( nametune )
  2098.     PORT_START    /* IN0 */
  2099.     PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ))
  2100.     PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ))
  2101.     PORT_DIPSETTING(    0x03, DEF_STR( 3C_2C ))
  2102.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ))
  2103.     PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ))
  2104.     PORT_DIPNAME( 0x1c, 0x00, "Bonus Coins" )
  2105.     PORT_DIPSETTING(    0x00, "None" )
  2106.     PORT_DIPSETTING(    0x04, "2 Coins = 1 Bonus" )
  2107.     PORT_DIPSETTING(    0x08, "3 Coins = 1 Bonus" )
  2108.     PORT_DIPSETTING(    0x0c, "4 Coins = 1 Bonus" )
  2109.     PORT_DIPSETTING(    0x10, "4 Coins = 2 Bonus" )
  2110.     PORT_DIPSETTING(    0x14, "5 Coins = 1 Bonus" )
  2111.     PORT_DIPSETTING(    0x18, "5 Coins = 2 Bonus" )
  2112.     PORT_DIPSETTING(    0x1c, "5 Coins = 3 Bonus" )
  2113.     PORT_DIPNAME( 0x20, 0x00, "Left Coin Mech" )
  2114.     PORT_DIPSETTING(    0x00, "x1" )
  2115.     PORT_DIPSETTING(    0x20, "x2" )
  2116.     PORT_DIPNAME( 0xc0, 0x00, "Right Coin Mech" )
  2117.     PORT_DIPSETTING(    0x00, "x1" )
  2118.     PORT_DIPSETTING(    0x40, "x4" )
  2119.     PORT_DIPSETTING(    0x80, "x5" )
  2120.     PORT_DIPSETTING(    0xc0, "x6" )
  2121.  
  2122.     PORT_START    /* IN1 */
  2123.     PORT_BIT( 0x7f, IP_ACTIVE_LOW, IPT_UNKNOWN )
  2124.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ))
  2125.     PORT_DIPSETTING(    0x80, DEF_STR( Off ))
  2126.     PORT_DIPSETTING(    0x00, DEF_STR( On ))
  2127.  
  2128.     PORT_START    /* IN2 */
  2129.     PORT_BITX(0x01, IP_ACTIVE_LOW, IPT_BUTTON4 | IPF_PLAYER1, "P1 Blue Button", IP_KEY_DEFAULT, IP_JOY_DEFAULT )
  2130.     PORT_BITX(0x02, IP_ACTIVE_LOW, IPT_BUTTON3 | IPF_PLAYER1, "P1 Green Button", IP_KEY_DEFAULT, IP_JOY_DEFAULT )
  2131.     PORT_BITX(0x04, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER1, "P1 Yellow Button", IP_KEY_DEFAULT, IP_JOY_DEFAULT )
  2132.     PORT_BITX(0x08, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER1, "P1 Red Button", IP_KEY_DEFAULT, IP_JOY_DEFAULT )
  2133.     PORT_BIT( 0x30, IP_ACTIVE_LOW, IPT_UNUSED )
  2134.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
  2135.     PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
  2136.  
  2137.     PORT_START    /* IN3 */
  2138.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
  2139.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
  2140.     PORT_BITX(0x04, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2, "P2 Red Button", IP_KEY_DEFAULT, IP_JOY_DEFAULT )
  2141.     PORT_BITX(0x08, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER2, "P2 Yellow Button", IP_KEY_DEFAULT, IP_JOY_DEFAULT )
  2142.     PORT_BITX(0x10, IP_ACTIVE_LOW, IPT_BUTTON3 | IPF_PLAYER2, "P2 Green Button", IP_KEY_DEFAULT, IP_JOY_DEFAULT )
  2143.     PORT_BITX(0x20, IP_ACTIVE_LOW, IPT_BUTTON4 | IPF_PLAYER2, "P2 Blue Button", IP_KEY_DEFAULT, IP_JOY_DEFAULT )
  2144.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
  2145.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
  2146.  
  2147.     /* analog ports */
  2148.     UNUSED_ANALOG_X4
  2149. INPUT_PORTS_END
  2150.  
  2151.  
  2152. INPUT_PORTS_START( nstocker )
  2153.     PORT_START    /* IN0 */
  2154.     PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ))
  2155.     PORT_DIPSETTING(    0x03, DEF_STR( 3C_1C ))
  2156.     PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ))
  2157.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ))
  2158.     PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ))
  2159.     PORT_DIPNAME( 0x1c, 0x00, "Bonus Coins" )
  2160.     PORT_DIPSETTING(    0x00, "None" )
  2161.     PORT_DIPSETTING(    0x04, "2 Coins = 1 Bonus" )
  2162.     PORT_DIPSETTING(    0x08, "3 Coins = 1 Bonus" )
  2163.     PORT_DIPSETTING(    0x0c, "4 Coins = 1 Bonus" )
  2164.     PORT_DIPSETTING(    0x10, "4 Coins = 2 Bonus" )
  2165.     PORT_DIPSETTING(    0x14, "5 Coins = 1 Bonus" )
  2166.     PORT_DIPSETTING(    0x18, "5 Coins = 2 Bonus" )
  2167.     PORT_DIPSETTING(    0x1c, "5 Coins = 3 Bonus" )
  2168.     PORT_DIPNAME( 0x20, 0x00, "Left Coin Mech" )
  2169.     PORT_DIPSETTING(    0x00, "x1" )
  2170.     PORT_DIPSETTING(    0x20, "x2" )
  2171.     PORT_DIPNAME( 0xc0, 0x00, "Right Coin Mech" )
  2172.     PORT_DIPSETTING(    0x00, "x1" )
  2173.     PORT_DIPSETTING(    0x40, "x4" )
  2174.     PORT_DIPSETTING(    0x80, "x5" )
  2175.     PORT_DIPSETTING(    0xc0, "x6" )
  2176.  
  2177.     PORT_START    /* IN1 */
  2178.     PORT_DIPNAME( 0x01, 0x00, DEF_STR( Difficulty ))
  2179.     PORT_DIPSETTING(    0x01, "Easy" )
  2180.     PORT_DIPSETTING(    0x00, "Hard" )
  2181.     PORT_BIT( 0x7e, IP_ACTIVE_LOW, IPT_UNUSED )
  2182.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ))
  2183.     PORT_DIPSETTING(    0x80, DEF_STR( Off ))
  2184.     PORT_DIPSETTING(    0x00, DEF_STR( On ))
  2185.  
  2186.     PORT_START    /* IN2 */
  2187.     PORT_BIT( 0x3f, IP_ACTIVE_LOW, IPT_UNUSED )
  2188.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
  2189.     PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
  2190.  
  2191.     PORT_START    /* IN3 */
  2192.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
  2193.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 )
  2194.     PORT_BIT( 0x3c, IP_ACTIVE_LOW, IPT_UNUSED )
  2195.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
  2196.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
  2197.  
  2198.     /* analog ports */
  2199.     UNUSED_ANALOG_X3
  2200.     /* cheese alert -- we have to map this to player 2 so that it doesn't interfere with */
  2201.     /* the crosshair controls */
  2202.     PORT_START
  2203.     PORT_ANALOGX( 0xff, 0, IPT_DIAL | IPF_PLAYER2 | IPF_CENTER, 100, 20, 0, 0,
  2204.                     KEYCODE_S, KEYCODE_F, JOYCODE_1_LEFT, JOYCODE_1_RIGHT )
  2205.  
  2206.     /* extra ports for shooters */
  2207.     PLAYER1_CROSSHAIRS
  2208. INPUT_PORTS_END
  2209.  
  2210.  
  2211. INPUT_PORTS_START( sfootbal )
  2212.     PORT_START    /* IN0 */
  2213.     PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ))
  2214.     PORT_DIPSETTING(    0x03, DEF_STR( 3C_1C ))
  2215.     PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ))
  2216.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ))
  2217.     PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ))
  2218.     PORT_DIPNAME( 0x1c, 0x00, "Bonus Coins" )
  2219.     PORT_DIPSETTING(    0x00, "None" )
  2220.     PORT_DIPSETTING(    0x04, "2 Coins = 1 Bonus" )
  2221.     PORT_DIPSETTING(    0x08, "3 Coins = 1 Bonus" )
  2222.     PORT_DIPSETTING(    0x0c, "4 Coins = 1 Bonus" )
  2223.     PORT_DIPSETTING(    0x10, "4 Coins = 2 Bonus" )
  2224.     PORT_DIPSETTING(    0x14, "5 Coins = 1 Bonus" )
  2225.     PORT_DIPSETTING(    0x18, "5 Coins = 2 Bonus" )
  2226.     PORT_DIPSETTING(    0x1c, "5 Coins = 3 Bonus" )
  2227.     PORT_DIPNAME( 0x20, 0x00, "Left Coin Mech" )
  2228.     PORT_DIPSETTING(    0x00, "x1" )
  2229.     PORT_DIPSETTING(    0x20, "x2" )
  2230.     PORT_DIPNAME( 0xc0, 0x00, "Right Coin Mech" )
  2231.     PORT_DIPSETTING(    0x00, "x1" )
  2232.     PORT_DIPSETTING(    0x40, "x4" )
  2233.     PORT_DIPSETTING(    0x80, "x5" )
  2234.     PORT_DIPSETTING(    0xc0, "x6" )
  2235.  
  2236.     PORT_START    /* IN1 */
  2237.     PORT_DIPNAME( 0x07, 0x03, "Game Duration" )
  2238.     PORT_DIPSETTING(    0x00, "1:30" )
  2239.     PORT_DIPSETTING(    0x01, "1:40" )
  2240.     PORT_DIPSETTING(    0x02, "1:50" )
  2241.     PORT_DIPSETTING(    0x03, "2:00" )
  2242.     PORT_DIPSETTING(    0x04, "2:20" )
  2243.     PORT_DIPSETTING(    0x05, "2:40" )
  2244.     PORT_DIPSETTING(    0x06, "3:00" )
  2245.     PORT_DIPSETTING(    0x07, "3:30" )
  2246.     PORT_DIPNAME( 0x08, 0x00, "Players Per Credit" )
  2247.     PORT_DIPSETTING(    0x00, "1" )
  2248.     PORT_DIPSETTING(    0x08, "1 or 2" )
  2249.     PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_UNUSED )
  2250.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ))
  2251.     PORT_DIPSETTING(    0x80, DEF_STR( Off ))
  2252.     PORT_DIPSETTING(    0x00, DEF_STR( On ))
  2253.  
  2254.     PORT_START    /* IN2 */
  2255.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER1 )
  2256.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
  2257.     PORT_BIT( 0x3c, IP_ACTIVE_LOW, IPT_UNUSED )
  2258.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
  2259.     PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
  2260.  
  2261.     PORT_START    /* IN3 */
  2262.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
  2263.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
  2264.     PORT_BIT( 0x3c, IP_ACTIVE_LOW, IPT_UNUSED )
  2265.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
  2266.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
  2267.  
  2268.     /* analog ports */
  2269.     PLAYER2_ANALOG_JOYSTICK
  2270.     PLAYER1_ANALOG_JOYSTICK
  2271. INPUT_PORTS_END
  2272.  
  2273.  
  2274. INPUT_PORTS_START( spiker )
  2275.     PORT_START    /* IN0 */
  2276.     PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ))
  2277.     PORT_DIPSETTING(    0x03, DEF_STR( 3C_1C ))
  2278.     PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ))
  2279.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ))
  2280.     PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ))
  2281.     PORT_DIPNAME( 0x1c, 0x00, "Bonus Coins" )
  2282.     PORT_DIPSETTING(    0x00, "None" )
  2283.     PORT_DIPSETTING(    0x04, "2 Coins = 1 Bonus" )
  2284.     PORT_DIPSETTING(    0x08, "3 Coins = 1 Bonus" )
  2285.     PORT_DIPSETTING(    0x0c, "4 Coins = 1 Bonus" )
  2286.     PORT_DIPSETTING(    0x10, "4 Coins = 2 Bonus" )
  2287.     PORT_DIPSETTING(    0x14, "5 Coins = 1 Bonus" )
  2288.     PORT_DIPSETTING(    0x18, "5 Coins = 2 Bonus" )
  2289.     PORT_DIPSETTING(    0x1c, "5 Coins = 3 Bonus" )
  2290.     PORT_DIPNAME( 0x20, 0x00, "Left Coin Mech" )
  2291.     PORT_DIPSETTING(    0x00, "x1" )
  2292.     PORT_DIPSETTING(    0x20, "x2" )
  2293.     PORT_DIPNAME( 0xc0, 0x00, "Right Coin Mech" )
  2294.     PORT_DIPSETTING(    0x00, "x1" )
  2295.     PORT_DIPSETTING(    0x40, "x4" )
  2296.     PORT_DIPSETTING(    0x80, "x5" )
  2297.     PORT_DIPSETTING(    0xc0, "x6" )
  2298.  
  2299.     PORT_START    /* IN1 */
  2300.     PORT_DIPNAME( 0x01, 0x00, "Game Duration" )
  2301.     PORT_DIPSETTING(    0x00, "11 points" )
  2302.     PORT_DIPSETTING(    0x01, "15 points" )
  2303.     PORT_BIT( 0x7e, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  2304.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ))
  2305.     PORT_DIPSETTING(    0x80, DEF_STR( Off ))
  2306.     PORT_DIPSETTING(    0x00, DEF_STR( On ))
  2307.  
  2308.     PORT_START    /* IN2 */
  2309.     PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNUSED )
  2310.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
  2311.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
  2312.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
  2313.     PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
  2314.  
  2315.     PORT_START    /* IN3 */
  2316.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
  2317.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
  2318.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER1 )
  2319.     PORT_BIT( 0x38, IP_ACTIVE_LOW, IPT_UNUSED )
  2320.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
  2321.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
  2322.  
  2323.     /* analog ports */
  2324.     PLAYER2_TRACKBALL
  2325.     PLAYER1_TRACKBALL
  2326. INPUT_PORTS_END
  2327.  
  2328.  
  2329. INPUT_PORTS_START( rescraid )
  2330.     PORT_START    /* IN0 */
  2331.     PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ))
  2332.     PORT_DIPSETTING(    0x03, DEF_STR( 3C_1C ))
  2333.     PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ))
  2334.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ))
  2335.     PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ))
  2336.     PORT_DIPNAME( 0x1c, 0x00, "Bonus Coins" )
  2337.     PORT_DIPSETTING(    0x00, "None" )
  2338.     PORT_DIPSETTING(    0x04, "2 Coins = 1 Bonus" )
  2339.     PORT_DIPSETTING(    0x08, "3 Coins = 1 Bonus" )
  2340.     PORT_DIPSETTING(    0x0c, "4 Coins = 1 Bonus" )
  2341.     PORT_DIPSETTING(    0x10, "4 Coins = 2 Bonus" )
  2342.     PORT_DIPSETTING(    0x14, "5 Coins = 1 Bonus" )
  2343.     PORT_DIPSETTING(    0x18, "5 Coins = 2 Bonus" )
  2344.     PORT_DIPSETTING(    0x1c, "5 Coins = 3 Bonus" )
  2345.     PORT_DIPNAME( 0x20, 0x00, "Left Coin Mech" )
  2346.     PORT_DIPSETTING(    0x00, "x1" )
  2347.     PORT_DIPSETTING(    0x20, "x2" )
  2348.     PORT_DIPNAME( 0xc0, 0x00, "Right Coin Mech" )
  2349.     PORT_DIPSETTING(    0x00, "x1" )
  2350.     PORT_DIPSETTING(    0x40, "x4" )
  2351.     PORT_DIPSETTING(    0x80, "x5" )
  2352.     PORT_DIPSETTING(    0xc0, "x6" )
  2353.  
  2354.     PORT_START    /* IN1 */
  2355.     PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ))
  2356.     PORT_DIPSETTING(    0x00, "4" )
  2357.     PORT_DIPSETTING(    0x01, "5" )
  2358.     PORT_DIPNAME( 0x0c, 0x04, "Minimum Game Time" )
  2359.     PORT_DIPSETTING(    0x08, "45" )
  2360.     PORT_DIPSETTING(    0x04, "60" )
  2361.     PORT_DIPSETTING(    0x00, "90" )
  2362.     PORT_DIPSETTING(    0x0c, "120" )
  2363.     PORT_BIT( 0x30, IP_ACTIVE_LOW, IPT_BUTTON1 )
  2364.     PORT_DIPNAME( 0x40, 0x40, "Keep High Scores" )
  2365.     PORT_DIPSETTING(    0x40, DEF_STR( No ))
  2366.     PORT_DIPSETTING(    0x00, DEF_STR( Yes ))
  2367.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ))
  2368.     PORT_DIPSETTING(    0x80, DEF_STR( Off ))
  2369.     PORT_DIPSETTING(    0x00, DEF_STR( On ))
  2370.  
  2371.     PORT_START    /* IN2 */
  2372.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP | IPF_PLAYER1 )
  2373.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN | IPF_PLAYER1 )
  2374.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_RIGHT | IPF_PLAYER1 )
  2375.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_LEFT | IPF_PLAYER1 )
  2376.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
  2377.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
  2378.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
  2379.     PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
  2380.  
  2381.     PORT_START    /* IN3 */
  2382.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
  2383.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
  2384.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP | IPF_PLAYER1 )
  2385.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN | IPF_PLAYER1 )
  2386.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT | IPF_PLAYER1 )
  2387.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT | IPF_PLAYER1 )
  2388.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
  2389.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
  2390.  
  2391.     /* analog ports */
  2392.     UNUSED_ANALOG_X4
  2393. INPUT_PORTS_END
  2394.  
  2395.  
  2396.  
  2397. /*************************************
  2398.  *
  2399.  *    Sound definitions
  2400.  *
  2401.  *************************************/
  2402.  
  2403. static struct cem3394_interface cem_interface =
  2404. {
  2405.     6,
  2406.     { 90, 90, 90, 90, 90, 90 },
  2407.     { 431.894, 431.894, 431.894, 431.894, 431.894, 431.894 },
  2408.     { 1300.0, 1300.0, 1300.0, 1300.0, 1300.0, 1300.0 },
  2409.     { noise_gen, noise_gen, noise_gen, noise_gen, noise_gen, noise_gen }
  2410. };
  2411.  
  2412.  
  2413.  
  2414. /*************************************
  2415.  *
  2416.  *    Machine driver
  2417.  *
  2418.  *************************************/
  2419.  
  2420. static struct MachineDriver machine_driver_balsente =
  2421. {
  2422.     /* basic machine hardware */
  2423.     {
  2424.         {
  2425.             CPU_M6809,
  2426.             5000000/4,                     /* 5Mhz/4 */
  2427.             readmem_cpu1,writemem_cpu1,0,0,
  2428.             update_analog_inputs,1
  2429.         },
  2430.         {
  2431.             CPU_Z80 | CPU_AUDIO_CPU,
  2432.             4000000,                       /* 4Mhz */
  2433.             readmem_cpu2,writemem_cpu2,readport_cpu2,writeport_cpu2,
  2434.             ignore_interrupt,1
  2435.         }
  2436.     },
  2437.     60, DEFAULT_REAL_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  2438.     10,
  2439.     init_machine,
  2440.  
  2441.     /* video hardware */
  2442.     256, 240, { 0, 255, 0, 239 },
  2443.     0,
  2444.     1025,1025,
  2445.     0,
  2446.  
  2447.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE | VIDEO_UPDATE_BEFORE_VBLANK,
  2448.     0,
  2449.     balsente_vh_start,
  2450.     balsente_vh_stop,
  2451.     balsente_vh_screenrefresh,
  2452.  
  2453.     /* sound hardware */
  2454.     0,0,0,0,
  2455.     {
  2456.         {
  2457.             SOUND_CEM3394,
  2458.             &cem_interface
  2459.         }
  2460.     },
  2461.  
  2462.     nvram_handler
  2463. };
  2464.  
  2465.  
  2466.  
  2467. /*************************************
  2468.  *
  2469.  *    Driver initialization
  2470.  *
  2471.  *************************************/
  2472.  
  2473. #define EXPAND_ALL        0x00
  2474. #define EXPAND_NONE        0x3f
  2475. #define SWAP_HALVES        0x80
  2476.  
  2477. static void expand_roms(UINT8 cd_rom_mask)
  2478. {
  2479.     /* load AB bank data from 0x10000-0x20000 */
  2480.     /* load CD bank data from 0x20000-0x2e000 */
  2481.     /* load EF           from 0x2e000-0x30000 */
  2482.     /* ROM region must be 0x40000 total */
  2483.  
  2484.     UINT8 *temp = malloc(0x20000);
  2485.     if (temp)
  2486.     {
  2487.         UINT8 *rom = memory_region(REGION_CPU1);
  2488.         UINT32 base;
  2489.  
  2490.         for (base = 0x10000; base < memory_region_length(REGION_CPU1); base += 0x30000)
  2491.         {
  2492.             UINT8 *ab_base = &temp[0x00000];
  2493.             UINT8 *cd_base = &temp[0x10000];
  2494.             UINT8 *cd_common = &temp[0x1c000];
  2495.             UINT8 *ef_common = &temp[0x1e000];
  2496.             UINT32 dest;
  2497.  
  2498.             for (dest = 0x00000; dest < 0x20000; dest += 0x02000)
  2499.             {
  2500.                 if (cd_rom_mask & SWAP_HALVES)
  2501.                     memcpy(&temp[dest ^ 0x02000], &rom[base + dest], 0x02000);
  2502.                 else
  2503.                     memcpy(&temp[dest], &rom[base + dest], 0x02000);
  2504.             }
  2505.  
  2506.             memcpy(&rom[base + 0x2e000], ef_common, 0x2000);
  2507.             memcpy(&rom[base + 0x2c000], cd_common, 0x2000);
  2508.             memcpy(&rom[base + 0x2a000], &ab_base[0xe000], 0x2000);
  2509.  
  2510.             memcpy(&rom[base + 0x28000], ef_common, 0x2000);
  2511.             memcpy(&rom[base + 0x26000], cd_common, 0x2000);
  2512.             memcpy(&rom[base + 0x24000], &ab_base[0xc000], 0x2000);
  2513.  
  2514.             memcpy(&rom[base + 0x22000], ef_common, 0x2000);
  2515.             memcpy(&rom[base + 0x20000], (cd_rom_mask & 0x20) ? &cd_base[0xa000] : cd_common, 0x2000);
  2516.             memcpy(&rom[base + 0x1e000], &ab_base[0xa000], 0x2000);
  2517.  
  2518.             memcpy(&rom[base + 0x1c000], ef_common, 0x2000);
  2519.             memcpy(&rom[base + 0x1a000], (cd_rom_mask & 0x10) ? &cd_base[0x8000] : cd_common, 0x2000);
  2520.             memcpy(&rom[base + 0x18000], &ab_base[0x8000], 0x2000);
  2521.  
  2522.             memcpy(&rom[base + 0x16000], ef_common, 0x2000);
  2523.             memcpy(&rom[base + 0x14000], (cd_rom_mask & 0x08) ? &cd_base[0x6000] : cd_common, 0x2000);
  2524.             memcpy(&rom[base + 0x12000], &ab_base[0x6000], 0x2000);
  2525.  
  2526.             memcpy(&rom[base + 0x10000], ef_common, 0x2000);
  2527.             memcpy(&rom[base + 0x0e000], (cd_rom_mask & 0x04) ? &cd_base[0x4000] : cd_common, 0x2000);
  2528.             memcpy(&rom[base + 0x0c000], &ab_base[0x4000], 0x2000);
  2529.  
  2530.             memcpy(&rom[base + 0x0a000], ef_common, 0x2000);
  2531.             memcpy(&rom[base + 0x08000], (cd_rom_mask & 0x02) ? &cd_base[0x2000] : cd_common, 0x2000);
  2532.             memcpy(&rom[base + 0x06000], &ab_base[0x2000], 0x2000);
  2533.  
  2534.             memcpy(&rom[base + 0x04000], ef_common, 0x2000);
  2535.             memcpy(&rom[base + 0x02000], (cd_rom_mask & 0x01) ? &cd_base[0x0000] : cd_common, 0x2000);
  2536.             memcpy(&rom[base + 0x00000], &ab_base[0x0000], 0x2000);
  2537.         }
  2538.  
  2539.         free(temp);
  2540.     }
  2541. }
  2542.  
  2543. static void init_sentetst(void) { expand_roms(EXPAND_ALL);  balsente_shooter = 0; /* noanalog */ }
  2544. static void init_cshift(void)   { expand_roms(EXPAND_ALL);  balsente_shooter = 0; /* noanalog */ }
  2545. static void init_gghost(void)   { expand_roms(EXPAND_ALL);  balsente_shooter = 0; adc_shift = 1; }
  2546. static void init_hattrick(void) { expand_roms(EXPAND_ALL);  balsente_shooter = 0; /* noanalog */ }
  2547. static void init_otwalls(void)  { expand_roms(EXPAND_ALL);  balsente_shooter = 0; adc_shift = 0; }
  2548. static void init_snakepit(void) { expand_roms(EXPAND_ALL);  balsente_shooter = 0; adc_shift = 1; }
  2549. static void init_snakjack(void) { expand_roms(EXPAND_ALL);  balsente_shooter = 0; adc_shift = 1; }
  2550. static void init_stocker(void)  { expand_roms(EXPAND_ALL);  balsente_shooter = 0; adc_shift = 0; }
  2551. static void init_triviag1(void) { expand_roms(EXPAND_ALL);  balsente_shooter = 0; /* noanalog */ }
  2552. static void init_triviag2(void)
  2553. {
  2554.     memcpy(&memory_region(REGION_CPU1)[0x20000], &memory_region(REGION_CPU1)[0x28000], 0x4000);
  2555.     memcpy(&memory_region(REGION_CPU1)[0x24000], &memory_region(REGION_CPU1)[0x28000], 0x4000);
  2556.     expand_roms(EXPAND_NONE); balsente_shooter = 0; /* noanalog */
  2557. }
  2558. static void init_gimeabrk(void) { expand_roms(EXPAND_ALL);  balsente_shooter = 0; adc_shift = 1; }
  2559. static void init_minigolf(void) { expand_roms(0x0c);        balsente_shooter = 0; adc_shift = 2; }
  2560. static void init_minigol2(void) { expand_roms(EXPAND_NONE); balsente_shooter = 0; adc_shift = 2; }
  2561. static void init_toggle(void)   { expand_roms(EXPAND_ALL);  balsente_shooter = 0; /* noanalog */ }
  2562. static void init_nametune(void) { expand_roms(EXPAND_NONE | SWAP_HALVES); balsente_shooter = 0; /* noanalog */ }
  2563. static void init_nstocker(void)
  2564. {
  2565.     install_mem_read_handler(0, 0x9902, 0x9902, nstocker_port2_r);
  2566.     expand_roms(EXPAND_NONE | SWAP_HALVES); balsente_shooter = 1; adc_shift = 1;
  2567. }
  2568. static void init_sfootbal(void) { expand_roms(EXPAND_ALL  | SWAP_HALVES); balsente_shooter = 0; adc_shift = 0; }
  2569. static void init_spiker(void)
  2570. {
  2571.     install_mem_write_handler(0, 0x9f80, 0x9f8f, spiker_expand_w);
  2572.     install_mem_read_handler(0, 0x9f80, 0x9f8f, spiker_expand_r);
  2573.     expand_roms(EXPAND_ALL  | SWAP_HALVES); balsente_shooter = 0; adc_shift = 1;
  2574. }
  2575. static void init_rescraid(void) { expand_roms(EXPAND_NONE); balsente_shooter = 0; /* noanalog */ }
  2576.  
  2577.  
  2578.  
  2579. /*************************************
  2580.  *
  2581.  *    ROM definitions
  2582.  *
  2583.  *************************************/
  2584.  
  2585. ROM_START( sentetst )
  2586.     ROM_REGION( 0x40000, REGION_CPU1 )     /* 64k for code for the first CPU, plus 128k of banked ROMs */
  2587.     ROM_LOAD( "sdiagef.bin",  0x2e000, 0x2000, 0x2a39fc53 )
  2588.  
  2589.     ROM_REGION( 0x10000, REGION_CPU2 )        /* 64k for Z80 */
  2590.     ROM_LOAD( "sentesnd",     0x00000, 0x2000, 0x4dd0a525 )
  2591.  
  2592.     ROM_REGION( 0x10000, REGION_GFX1 )        /* up to 64k of sprites */
  2593.     ROM_LOAD( "sdiaggr0.bin", 0x00000, 0x2000, 0x5e0ff62a )
  2594. ROM_END
  2595.  
  2596.  
  2597. ROM_START( cshift )
  2598.     ROM_REGION( 0x40000, REGION_CPU1 )     /* 64k for code for the first CPU, plus 128k of banked ROMs */
  2599.     ROM_LOAD( "cs-ab0.bin", 0x10000, 0x2000, 0xd2069e75 )
  2600.     ROM_LOAD( "cs-ab1.bin", 0x12000, 0x2000, 0x198f25a8 )
  2601.     ROM_LOAD( "cs-ab2.bin", 0x14000, 0x2000, 0x2e2b2b82 )
  2602.     ROM_LOAD( "cs-ab3.bin", 0x16000, 0x2000, 0xb97fc520 )
  2603.     ROM_LOAD( "cs-ab4.bin", 0x18000, 0x2000, 0xb4f0d673 )
  2604.     ROM_LOAD( "cs-ab5.bin", 0x1a000, 0x2000, 0xb1f8e589 )
  2605.     ROM_LOAD( "cs-cd.bin",  0x2c000, 0x2000, 0xf555a0b2 )
  2606.     ROM_LOAD( "cs-ef.bin",  0x2e000, 0x2000, 0x368b1ce3 )
  2607.  
  2608.     ROM_REGION( 0x10000, REGION_CPU2 )        /* 64k for Z80 */
  2609.     ROM_LOAD( "sentesnd",   0x00000, 0x2000, 0x4dd0a525 )
  2610.  
  2611.     ROM_REGION( 0x10000, REGION_GFX1 )        /* up to 64k of sprites */
  2612.     ROM_LOAD( "cs-gr0.bin", 0x00000, 0x2000, 0x67f9d3b3 )
  2613.     ROM_LOAD( "cs-gr1.bin", 0x02000, 0x2000, 0x78973d50 )
  2614.     ROM_LOAD( "cs-gr2.bin", 0x04000, 0x2000, 0x1784f939 )
  2615.     ROM_LOAD( "cs-gr3.bin", 0x06000, 0x2000, 0xb43916a2 )
  2616.     ROM_LOAD( "cs-gr4.bin", 0x08000, 0x2000, 0xa94cd35b )
  2617. ROM_END
  2618.  
  2619.  
  2620. ROM_START( gghost )
  2621.     ROM_REGION( 0x40000, REGION_CPU1 )     /* 64k for code for the first CPU, plus 128k of banked ROMs */
  2622.     ROM_LOAD( "ggh-ab0.bin", 0x10000, 0x2000, 0xed0fdeac )
  2623.     ROM_LOAD( "ggh-ab1.bin", 0x12000, 0x2000, 0x5bfbae58 )
  2624.     ROM_LOAD( "ggh-ab2.bin", 0x14000, 0x2000, 0xf0baf921 )
  2625.     ROM_LOAD( "ggh-ab3.bin", 0x16000, 0x2000, 0xed0fdeac )
  2626.     ROM_LOAD( "ggh-ab4.bin", 0x18000, 0x2000, 0x5bfbae58 )
  2627.     ROM_LOAD( "ggh-ab5.bin", 0x1a000, 0x2000, 0xf0baf921 )
  2628.     ROM_LOAD( "ggh-cd.bin",  0x2c000, 0x2000, 0xd3d75f84 )
  2629.     ROM_LOAD( "ggh-ef.bin",  0x2e000, 0x2000, 0xa02b4243 )
  2630.  
  2631.     ROM_REGION( 0x10000, REGION_CPU2 )        /* 64k for Z80 */
  2632.     ROM_LOAD( "sentesnd",    0x00000, 0x2000, 0x4dd0a525 )
  2633.  
  2634.     ROM_REGION( 0x10000, REGION_GFX1 )        /* up to 64k of sprites */
  2635.     ROM_LOAD( "ggh-gr0.bin", 0x00000, 0x2000, 0x03515526 )
  2636.     ROM_LOAD( "ggh-gr1.bin", 0x02000, 0x2000, 0xb4293435 )
  2637.     ROM_LOAD( "ggh-gr2.bin", 0x04000, 0x2000, 0xece0cb97 )
  2638.     ROM_LOAD( "ggh-gr3.bin", 0x06000, 0x2000, 0xdd7e25d0 )
  2639.     ROM_LOAD( "ggh-gr4.bin", 0x08000, 0x2000, 0xb4293435 )
  2640.     ROM_LOAD( "ggh-gr5.bin", 0x0a000, 0x2000, 0xd3da0093 )
  2641. ROM_END
  2642.  
  2643.  
  2644. ROM_START( hattrick )
  2645.     ROM_REGION( 0x40000, REGION_CPU1 )     /* 64k for code for the first CPU, plus 128k of banked ROMs */
  2646.     ROM_LOAD( "rom-ab0.u9a", 0x10000, 0x2000, 0xf25c1b99 )
  2647.     ROM_LOAD( "rom-ab1.u8a", 0x12000, 0x2000, 0xc1df3d1f )
  2648.     ROM_LOAD( "rom-ab2.u7a", 0x14000, 0x2000, 0xf6c41257 )
  2649.     ROM_LOAD( "rom-cd.u3a",  0x2c000, 0x2000, 0xfc44f36c )
  2650.     ROM_LOAD( "rom-ef.u2a",  0x2e000, 0x2000, 0xd8f910fb )
  2651.  
  2652.     ROM_REGION( 0x10000, REGION_CPU2 )        /* 64k for Z80 */
  2653.     ROM_LOAD( "sentesnd",    0x00000, 0x2000, 0x4dd0a525 )
  2654.  
  2655.     ROM_REGION( 0x10000, REGION_GFX1 )        /* up to 64k of sprites */
  2656.     ROM_LOAD( "rom-gr0.u9b", 0x00000, 0x2000, 0x9f41baba )
  2657.     ROM_LOAD( "rom-gr1.u8b", 0x02000, 0x2000, 0x951f08c9 )
  2658. ROM_END
  2659.  
  2660.  
  2661. ROM_START( otwalls )
  2662.     ROM_REGION( 0x40000, REGION_CPU1 )     /* 64k for code for the first CPU, plus 128k of banked ROMs */
  2663.     ROM_LOAD( "otw-ab0.bin", 0x10000, 0x2000, 0x474441c7 )
  2664.     ROM_LOAD( "otw-ab1.bin", 0x12000, 0x2000, 0x2e9e9411 )
  2665.     ROM_LOAD( "otw-ab2.bin", 0x14000, 0x2000, 0xba092128 )
  2666.     ROM_LOAD( "otw-ab3.bin", 0x16000, 0x2000, 0x74bc479d )
  2667.     ROM_LOAD( "otw-ab4.bin", 0x18000, 0x2000, 0xf5f67619 )
  2668.     ROM_LOAD( "otw-ab5.bin", 0x1a000, 0x2000, 0xf5f67619 )
  2669.     ROM_LOAD( "otw-cd.bin",  0x2c000, 0x2000, 0x8e2d15ab )
  2670.     ROM_LOAD( "otw-ef.bin",  0x2e000, 0x2000, 0x57eab299 )
  2671.  
  2672.     ROM_REGION( 0x10000, REGION_CPU2 )        /* 64k for Z80 */
  2673.     ROM_LOAD( "sentesnd",    0x00000, 0x2000, 0x4dd0a525 )
  2674.  
  2675.     ROM_REGION( 0x10000, REGION_GFX1 )        /* up to 64k of sprites */
  2676.     ROM_LOAD( "otw-gr0.bin", 0x00000, 0x2000, 0x210bad3c )
  2677.     ROM_LOAD( "otw-gr1.bin", 0x02000, 0x2000, 0x13e6aaa5 )
  2678.     ROM_LOAD( "otw-gr2.bin", 0x04000, 0x2000, 0x5cfefee5 )
  2679.     ROM_LOAD( "otw-gr3.bin", 0x06000, 0x2000, 0x6b17e4a9 )
  2680.     ROM_LOAD( "otw-gr4.bin", 0x08000, 0x2000, 0x15985c8c )
  2681.     ROM_LOAD( "otw-gr5.bin", 0x0a000, 0x2000, 0x448f7e3c )
  2682. ROM_END
  2683.  
  2684.  
  2685. ROM_START( snakepit )
  2686.     ROM_REGION( 0x40000, REGION_CPU1 )     /* 64k for code for the first CPU, plus 128k of banked ROMs */
  2687.     ROM_LOAD( "spit-ab0.bin", 0x10000, 0x2000, 0x5aa86081 )
  2688.     ROM_LOAD( "spit-ab1.bin", 0x12000, 0x2000, 0x588228b8 )
  2689.     ROM_LOAD( "spit-ab2.bin", 0x14000, 0x2000, 0x60173ab6 )
  2690.     ROM_LOAD( "spit-ab3.bin", 0x16000, 0x2000, 0x56cb51a8 )
  2691.     ROM_LOAD( "spit-ab4.bin", 0x18000, 0x2000, 0x40ba61e0 )
  2692.     ROM_LOAD( "spit-ab5.bin", 0x1a000, 0x2000, 0x2a1d9d8f )
  2693.     ROM_LOAD( "spit-cd.bin",  0x2c000, 0x2000, 0x54095cbb )
  2694.     ROM_LOAD( "spit-ef.bin",  0x2e000, 0x2000, 0x5f836a66 )
  2695.  
  2696.     ROM_REGION( 0x10000, REGION_CPU2 )        /* 64k for Z80 */
  2697.     ROM_LOAD( "sentesnd",     0x00000, 0x2000, 0x4dd0a525 )
  2698.  
  2699.     ROM_REGION( 0x10000, REGION_GFX1 )        /* up to 64k of sprites */
  2700.     ROM_LOAD( "spit-gr0.bin", 0x00000, 0x2000, 0xf77fd85d )
  2701.     ROM_LOAD( "spit-gr1.bin", 0x02000, 0x2000, 0x3ad10334 )
  2702.     ROM_LOAD( "spit-gr2.bin", 0x04000, 0x2000, 0x24887703 )
  2703.     ROM_LOAD( "spit-gr3.bin", 0x06000, 0x2000, 0xc6703ec2 )
  2704.     ROM_LOAD( "spit-gr4.bin", 0x08000, 0x2000, 0xb4293435 )
  2705.     ROM_LOAD( "spit-gr5.bin", 0x0a000, 0x2000, 0xdc27c970 )
  2706. ROM_END
  2707.  
  2708.  
  2709. ROM_START( snakjack )
  2710.     ROM_REGION( 0x40000, REGION_CPU1 )     /* 64k for code for the first CPU, plus 128k of banked ROMs */
  2711.     ROM_LOAD( "rom-ab0.u9a", 0x10000, 0x2000, 0xda2dd119 )
  2712.     ROM_LOAD( "rom-ab1.u8a", 0x12000, 0x2000, 0x657ddf26 )
  2713.     ROM_LOAD( "rom-ab2.u7a", 0x14000, 0x2000, 0x15333dcf )
  2714.     ROM_LOAD( "rom-ab3.u6a", 0x16000, 0x2000, 0x57671f6f )
  2715.     ROM_LOAD( "rom-ab4.u5a", 0x18000, 0x2000, 0xc16c5dc0 )
  2716.     ROM_LOAD( "rom-ab5.u4a", 0x1a000, 0x2000, 0xd7019747 )
  2717.     ROM_LOAD( "rom-cd.u3a",  0x2c000, 0x2000, 0x7b44ca4c )
  2718.     ROM_LOAD( "rom-ef.u1a",  0x2e000, 0x2000, 0xf5309b38 )
  2719.  
  2720.     ROM_REGION( 0x10000, REGION_CPU2 )        /* 64k for Z80 */
  2721.     ROM_LOAD( "sentesnd",    0x00000, 0x2000, 0x4dd0a525 )
  2722.  
  2723.     ROM_REGION( 0x10000, REGION_GFX1 )        /* up to 64k of sprites */
  2724.     ROM_LOAD( "rom-gr0.u9b", 0x00000, 0x2000, 0x3e64b5d5 )
  2725.     ROM_LOAD( "rom-gr1.u8b", 0x02000, 0x2000, 0xb3b8baee )
  2726.     ROM_LOAD( "rom-gr2.u7b", 0x04000, 0x2000, 0xe9d89dac )
  2727.     ROM_LOAD( "rom-gr3.u6b", 0x06000, 0x2000, 0xb6602be8 )
  2728.     ROM_LOAD( "rom-gr4.u5b", 0x08000, 0x2000, 0x3fbfa686 )
  2729.     ROM_LOAD( "rom-gr5.u4b", 0x0a000, 0x2000, 0x345f94fb )
  2730. ROM_END
  2731.  
  2732.  
  2733. ROM_START( stocker )
  2734.     ROM_REGION( 0x40000, REGION_CPU1 )     /* 64k for code for the first CPU, plus 128k of banked ROMs */
  2735.     ROM_LOAD( "stkr-ab0.bin", 0x10000, 0x2000, 0x784a00ad )
  2736.     ROM_LOAD( "stkr-ab1.bin", 0x12000, 0x2000, 0xcdae01dc )
  2737.     ROM_LOAD( "stkr-ab2.bin", 0x14000, 0x2000, 0x18527d57 )
  2738.     ROM_LOAD( "stkr-ab3.bin", 0x16000, 0x2000, 0x028f6c06 )
  2739.     ROM_LOAD( "stkr-cd.bin",  0x2c000, 0x2000, 0x53dbc4e5 )
  2740.     ROM_LOAD( "stkr-ef.bin",  0x2e000, 0x2000, 0xcdcf46bc )
  2741.  
  2742.     ROM_REGION( 0x10000, REGION_CPU2 )        /* 64k for Z80 */
  2743.     ROM_LOAD( "sentesnd",    0x00000, 0x2000, 0x4dd0a525 )
  2744.  
  2745.     ROM_REGION( 0x10000, REGION_GFX1 )        /* up to 64k of sprites */
  2746.     ROM_LOAD( "stkr-gr0.bin", 0x00000, 0x2000, 0x76d5694c )
  2747.     ROM_LOAD( "stkr-gr1.bin", 0x02000, 0x2000, 0x4a5cc00b )
  2748.     ROM_LOAD( "stkr-gr2.bin", 0x04000, 0x2000, 0x70002382 )
  2749.     ROM_LOAD( "stkr-gr3.bin", 0x06000, 0x2000, 0x68c862d8 )
  2750. ROM_END
  2751.  
  2752.  
  2753. ROM_START( triviag1 )
  2754.     ROM_REGION( 0x40000, REGION_CPU1 )     /* 64k for code for the first CPU, plus 128k of banked ROMs */
  2755.     ROM_LOAD( "tpg1-ab0.bin", 0x10000, 0x2000, 0x79fd3ac3 )
  2756.     ROM_LOAD( "tpg1-ab1.bin", 0x12000, 0x2000, 0x0ff677e9 )
  2757.     ROM_LOAD( "tpg1-ab2.bin", 0x14000, 0x2000, 0x3b4d03e7 )
  2758.     ROM_LOAD( "tpg1-ab3.bin", 0x16000, 0x2000, 0x2c6c0651 )
  2759.     ROM_LOAD( "tpg1-ab4.bin", 0x18000, 0x2000, 0x397529e7 )
  2760.     ROM_LOAD( "tpg1-ab5.bin", 0x1a000, 0x2000, 0x499773a4 )
  2761.     ROM_LOAD( "tpg1-cd.bin",  0x2c000, 0x2000, 0x35c9b9c2 )
  2762.     ROM_LOAD( "tpg1-ef.bin",  0x2e000, 0x2000, 0x64878342 )
  2763.  
  2764.     ROM_REGION( 0x10000, REGION_CPU2 )        /* 64k for Z80 */
  2765.     ROM_LOAD( "sentesnd",    0x00000, 0x2000, 0x4dd0a525 )
  2766.  
  2767.     ROM_REGION( 0x10000, REGION_GFX1 )        /* up to 64k of sprites */
  2768.     ROM_LOAD( "tpg1-gr0.bin", 0x00000, 0x2000, 0x20c9217a )
  2769.     ROM_LOAD( "tpg1-gr1.bin", 0x02000, 0x2000, 0xd7f44504 )
  2770.     ROM_LOAD( "tpg1-gr2.bin", 0x04000, 0x2000, 0x4e59a15d )
  2771.     ROM_LOAD( "tpg1-gr3.bin", 0x06000, 0x2000, 0x323a8640 )
  2772.     ROM_LOAD( "tpg1-gr4.bin", 0x08000, 0x2000, 0x673acf42 )
  2773.     ROM_LOAD( "tpg1-gr5.bin", 0x0a000, 0x2000, 0x067bfd66 )
  2774. ROM_END
  2775.  
  2776.  
  2777. ROM_START( triviag2 )
  2778.     ROM_REGION( 0x40000, REGION_CPU1 )     /* 64k for code for the first CPU, plus 128k of banked ROMs */
  2779.     ROM_LOAD( "ab01.bin",  0x10000, 0x4000, 0x4fca20c5 )
  2780.     ROM_LOAD( "ab23.bin",  0x14000, 0x4000, 0x6cf2ddeb )
  2781.     ROM_LOAD( "ab45.bin",  0x18000, 0x4000, 0xa7ff789c )
  2782.     ROM_LOAD( "ab67.bin",  0x1c000, 0x4000, 0xcc5c68ef )
  2783.     ROM_LOAD( "cd45.bin",  0x28000, 0x4000, 0xfc9c752a )
  2784.     ROM_LOAD( "cd6ef.bin", 0x2c000, 0x4000, 0x23b56fb8 )
  2785.  
  2786.     ROM_REGION( 0x10000, REGION_CPU2 )        /* 64k for Z80 */
  2787.     ROM_LOAD( "sentesnd",  0x00000, 0x2000, 0x4dd0a525 )
  2788.  
  2789.     ROM_REGION( 0x10000, REGION_GFX1 )        /* up to 64k of sprites */
  2790.     ROM_LOAD( "gr01.bin",  0x00000, 0x4000, 0x6829de8e )
  2791.     ROM_LOAD( "gr23.bin",  0x04000, 0x4000, 0x89398700 )
  2792.     ROM_LOAD( "gr45.bin",  0x08000, 0x4000, 0x1e870293 )
  2793. ROM_END
  2794.  
  2795.  
  2796. ROM_START( triviasp )
  2797.     ROM_REGION( 0x40000, REGION_CPU1 )     /* 64k for code for the first CPU, plus 128k of banked ROMs */
  2798.     ROM_LOAD( "allsport.8a", 0x10000, 0x4000, 0x54b7ff31 )
  2799.     ROM_LOAD( "allsport.7a", 0x14000, 0x4000, 0x59fae9d2 )
  2800.     ROM_LOAD( "allsport.6a", 0x18000, 0x4000, 0x237b6b95 )
  2801.     ROM_LOAD( "allsport.5a", 0x1c000, 0x4000, 0xb64d7f61 )
  2802.     ROM_LOAD( "allsport.3a", 0x28000, 0x4000, 0xe45d09d6 )
  2803.     ROM_LOAD( "allsport.1a", 0x2c000, 0x4000, 0x8bb3e831 )
  2804.  
  2805.     ROM_REGION( 0x10000, REGION_CPU2 )        /* 64k for Z80 */
  2806.     ROM_LOAD( "sentesnd",     0x00000, 0x2000, 0x4dd0a525 )
  2807.  
  2808.     ROM_REGION( 0x10000, REGION_GFX1 )        /* up to 64k of sprites */
  2809.     ROM_LOAD( "gr01.bin",    0x00000, 0x4000, 0x6829de8e )
  2810.     ROM_LOAD( "gr23.bin",    0x04000, 0x4000, 0x89398700 )
  2811.     ROM_LOAD( "allsport.3b", 0x08000, 0x4000, 0x7415a7fc )
  2812. ROM_END
  2813.  
  2814.  
  2815. ROM_START( triviayp )
  2816.     ROM_REGION( 0x40000, REGION_CPU1 )     /* 64k for code for the first CPU, plus 128k of banked ROMs */
  2817.     ROM_LOAD( "ab01.bin",  0x10000, 0x4000, 0x97d35a85 )
  2818.     ROM_LOAD( "ab23.bin",  0x14000, 0x4000, 0x2ff67c70 )
  2819.     ROM_LOAD( "ab45.bin",  0x18000, 0x4000, 0x511a0fab )
  2820.     ROM_LOAD( "ab67.bin",  0x1c000, 0x4000, 0xdf99d00c )
  2821.     ROM_LOAD( "cd45.bin",  0x28000, 0x4000, 0xac45809e )
  2822.     ROM_LOAD( "cd6ef.bin", 0x2c000, 0x4000, 0xa008059f )
  2823.  
  2824.     ROM_REGION( 0x10000, REGION_CPU2 )        /* 64k for Z80 */
  2825.     ROM_LOAD( "sentesnd",  0x00000, 0x2000, 0x4dd0a525 )
  2826.  
  2827.     ROM_REGION( 0x10000, REGION_GFX1 )        /* up to 64k of sprites */
  2828.     ROM_LOAD( "gr01.bin", 0x00000, 0x4000, 0x6829de8e )
  2829.     ROM_LOAD( "gr23.bin", 0x04000, 0x4000, 0x89398700 )
  2830.     ROM_LOAD( "gr45.bin", 0x08000, 0x4000, 0x1242033e )
  2831. ROM_END
  2832.  
  2833.  
  2834. ROM_START( triviabb )
  2835.     ROM_REGION( 0x40000, REGION_CPU1 )     /* 64k for code for the first CPU, plus 128k of banked ROMs */
  2836.     ROM_LOAD( "ab01.bin",  0x10000, 0x4000, 0x1b7c439d )
  2837.     ROM_LOAD( "ab23.bin",  0x14000, 0x4000, 0xe4f1e704 )
  2838.     ROM_LOAD( "ab45.bin",  0x18000, 0x4000, 0xdaa2d8bc )
  2839.     ROM_LOAD( "ab67.bin",  0x1c000, 0x4000, 0x3622c4f1 )
  2840.     ROM_LOAD( "cd45.bin",  0x28000, 0x4000, 0x07fd88ff )
  2841.     ROM_LOAD( "cd6ef.bin", 0x2c000, 0x4000, 0x2d03f241 )
  2842.  
  2843.     ROM_REGION( 0x10000, REGION_CPU2 )        /* 64k for Z80 */
  2844.     ROM_LOAD( "sentesnd",  0x00000, 0x2000, 0x4dd0a525 )
  2845.  
  2846.     ROM_REGION( 0x10000, REGION_GFX1 )        /* up to 64k of sprites */
  2847.     ROM_LOAD( "gr01.bin", 0x00000, 0x4000, 0x6829de8e )
  2848.     ROM_LOAD( "gr23.bin", 0x04000, 0x4000, 0x89398700 )
  2849.     ROM_LOAD( "gr45.bin", 0x08000, 0x4000, 0x92fb6fb1 )
  2850. ROM_END
  2851.  
  2852.  
  2853. ROM_START( gimeabrk )
  2854.     ROM_REGION( 0x40000, REGION_CPU1 )     /* 64k for code for the first CPU, plus 128k of banked ROMs */
  2855.     ROM_LOAD( "ab01.u8a",  0x10000, 0x4000, 0x18cc53db )
  2856.     ROM_LOAD( "ab23.u7a",  0x14000, 0x4000, 0x6bd4190a )
  2857.     ROM_LOAD( "ab45.u6a",  0x18000, 0x4000, 0x5dca4f33 )
  2858.     ROM_LOAD( "cd6ef.uia", 0x2c000, 0x4000, 0x5e2b3510 )
  2859.  
  2860.     ROM_REGION( 0x10000, REGION_CPU2 )        /* 64k for Z80 */
  2861.     ROM_LOAD( "sentesnd",  0x00000, 0x2000, 0x4dd0a525 )
  2862.  
  2863.     ROM_REGION( 0x10000, REGION_GFX1 )        /* up to 64k of sprites */
  2864.     ROM_LOAD( "gr01.u6b", 0x00000, 0x4000, 0xe3cdc476 )
  2865.     ROM_LOAD( "gr23.u5b", 0x04000, 0x4000, 0x0555d9c0 )
  2866. ROM_END
  2867.  
  2868.  
  2869. ROM_START( minigolf )
  2870.     ROM_REGION( 0x40000, REGION_CPU1 )     /* 64k for code for the first CPU, plus 128k of banked ROMs */
  2871.     ROM_LOAD( "ab01.u8a",  0x10000, 0x4000, 0x348f827f )
  2872.     ROM_LOAD( "ab23.u7a",  0x14000, 0x4000, 0x19a6ff47 )
  2873.     ROM_LOAD( "ab45.u6a",  0x18000, 0x4000, 0x925d76eb )
  2874.     ROM_LOAD( "ab67.u5a",  0x1c000, 0x4000, 0x6a311c9a )
  2875.     ROM_LOAD( "cd23.u3a",  0x24000, 0x4000, 0x52279801 )
  2876.     ROM_LOAD( "cd6ef.u1a", 0x2c000, 0x4000, 0x34c64f4c )
  2877.  
  2878.     ROM_REGION( 0x10000, REGION_CPU2 )        /* 64k for Z80 */
  2879.     ROM_LOAD( "sentesnd",  0x00000, 0x2000, 0x4dd0a525 )
  2880.  
  2881.     ROM_REGION( 0x10000, REGION_GFX1 )        /* up to 64k of sprites */
  2882.     ROM_LOAD( "gr01.u6b", 0x00000, 0x4000, 0x8e24d594 )
  2883.     ROM_LOAD( "gr23.u5b", 0x04000, 0x4000, 0x3bf355ef )
  2884.     ROM_LOAD( "gr45.u4b", 0x08000, 0x4000, 0x8eb14921 )
  2885. ROM_END
  2886.  
  2887.  
  2888. ROM_START( minigol2 )
  2889.     ROM_REGION( 0x40000, REGION_CPU1 )     /* 64k for code for the first CPU, plus 128k of banked ROMs */
  2890.     ROM_LOAD( "4a-ver2",  0x10000, 0x10000, 0x97d50493 )
  2891.     ROM_LOAD( "1a-ver2",  0x20000, 0x10000, 0x60b6cd58 )
  2892.  
  2893.     ROM_REGION( 0x10000, REGION_CPU2 )        /* 64k for Z80 */
  2894.     ROM_LOAD( "sentesnd",  0x00000, 0x2000, 0x4dd0a525 )
  2895.  
  2896.     ROM_REGION( 0x10000, REGION_GFX1 )        /* up to 64k of sprites */
  2897.     ROM_LOAD( "6b-ver2",  0x00000, 0x8000, 0x5988f4ba )
  2898.     ROM_LOAD( "4b-ver2",  0x08000, 0x8000, 0x78a30e23 )
  2899. ROM_END
  2900.  
  2901.  
  2902. ROM_START( toggle )
  2903.     ROM_REGION( 0x40000, REGION_CPU1 )     /* 64k for code for the first CPU, plus 128k of banked ROMs */
  2904.     ROM_LOAD( "tgle-ab0.bin", 0x10000, 0x2000, 0x8c7b7fad )
  2905.     ROM_LOAD( "tgle-ab1.bin", 0x12000, 0x2000, 0x771e5434 )
  2906.     ROM_LOAD( "tgle-ab2.bin", 0x14000, 0x2000, 0x9b4baa3f )
  2907.     ROM_LOAD( "tgle-ab3.bin", 0x16000, 0x2000, 0x35308a41 )
  2908.     ROM_LOAD( "tgle-ab4.bin", 0x18000, 0x2000, 0xbaf5617b )
  2909.     ROM_LOAD( "tgle-ab5.bin", 0x1a000, 0x2000, 0x88077dad )
  2910.     ROM_LOAD( "tgle-cd.bin",  0x2c000, 0x2000, 0x0a2bb949 )
  2911.     ROM_LOAD( "tgle-ef.bin",  0x2e000, 0x2000, 0x3ec10804 )
  2912.  
  2913.     ROM_REGION( 0x10000, REGION_CPU2 )        /* 64k for Z80 */
  2914.     ROM_LOAD( "sentesnd",    0x00000, 0x2000, 0x4dd0a525 )
  2915.  
  2916.     ROM_REGION( 0x10000, REGION_GFX1 )        /* up to 64k of sprites */
  2917.     ROM_LOAD( "tgle-gr0.bin", 0x00000, 0x2000, 0x0e0e5d0e )
  2918.     ROM_LOAD( "tgle-gr1.bin", 0x02000, 0x2000, 0x3b141ad2 )
  2919. ROM_END
  2920.  
  2921.  
  2922. ROM_START( nametune )
  2923.     ROM_REGION( 0x70000, REGION_CPU1 )     /* 64k for code for the first CPU, plus 128k of banked ROMs */
  2924.     ROM_LOAD( "nttab01.bin",  0x10000, 0x4000, 0xf99054f1 )
  2925.     ROM_CONTINUE(             0x40000, 0x4000 )
  2926.     ROM_LOAD( "nttab23.bin",  0x14000, 0x4000, 0xf2b8f7fa )
  2927.     ROM_CONTINUE(             0x44000, 0x4000 )
  2928.     ROM_LOAD( "nttab45.bin",  0x18000, 0x4000, 0x89e1c769 )
  2929.     ROM_CONTINUE(             0x48000, 0x4000 )
  2930.     ROM_LOAD( "nttab67.bin",  0x1c000, 0x4000, 0x7e5572a1 )
  2931.     ROM_CONTINUE(             0x4c000, 0x4000 )
  2932.     ROM_LOAD( "nttcd01.bin",  0x20000, 0x4000, 0xdb9d6154 )
  2933.     ROM_CONTINUE(             0x50000, 0x4000 )
  2934.     ROM_LOAD( "nttcd23.bin",  0x24000, 0x4000, 0x9d2e458f )
  2935.     ROM_CONTINUE(             0x54000, 0x4000 )
  2936.     ROM_LOAD( "nttcd45.bin",  0x28000, 0x4000, 0x9a4b87aa )
  2937.     ROM_CONTINUE(             0x58000, 0x4000 )
  2938.     ROM_LOAD( "nttcd6ef.bin", 0x2c000, 0x4000, 0x0459e6f8 )
  2939.     ROM_CONTINUE(             0x5c000, 0x4000 )
  2940.  
  2941.     ROM_REGION( 0x10000, REGION_CPU2 )        /* 64k for Z80 */
  2942.     ROM_LOAD( "sentesnd",  0x00000, 0x2000, 0x4dd0a525 )
  2943.  
  2944.     ROM_REGION( 0x10000, REGION_GFX1 )        /* up to 64k of sprites */
  2945.     ROM_LOAD( "nttgr0.bin",  0x00000, 0x8000, 0x6b75bb4b )
  2946. ROM_END
  2947.  
  2948.  
  2949. ROM_START( nstocker )
  2950.     ROM_REGION( 0x40000, REGION_CPU1 )     /* 64k for code for the first CPU, plus 128k of banked ROMs */
  2951.     ROM_LOAD( "ab01.u8a",  0x10000, 0x4000, 0xa635f973 )
  2952.     ROM_LOAD( "ab23.u7a",  0x14000, 0x4000, 0x223acbb2 )
  2953.     ROM_LOAD( "ab45.u6a",  0x18000, 0x4000, 0x27a728b5 )
  2954.     ROM_LOAD( "ab67.u5a",  0x1c000, 0x4000, 0x2999cdf2 )
  2955.     ROM_LOAD( "cd01.u4a",  0x20000, 0x4000, 0x75e9b51a )
  2956.     ROM_LOAD( "cd23.u3a",  0x24000, 0x4000, 0x0a32e0a5 )
  2957.     ROM_LOAD( "cd45.u2a",  0x28000, 0x4000, 0x9bb292fe )
  2958.     ROM_LOAD( "cd6ef.u1a", 0x2c000, 0x4000, 0xe77c1aea )
  2959.  
  2960.     ROM_REGION( 0x10000, REGION_CPU2 )        /* 64k for Z80 */
  2961.     ROM_LOAD( "sentesnd",  0x00000, 0x2000, 0x4dd0a525 )
  2962.  
  2963.     ROM_REGION( 0x10000, REGION_GFX1 )        /* up to 64k of sprites */
  2964.     ROM_LOAD( "gr01.u4c", 0x00000, 0x4000, 0xfd0c38be )
  2965.     ROM_LOAD( "gr23.u3c", 0x04000, 0x4000, 0x35d4433e )
  2966.     ROM_LOAD( "gr45.u2c", 0x08000, 0x4000, 0x734b858a )
  2967.     ROM_LOAD( "gr67.u1c", 0x0c000, 0x4000, 0x3311f9c0 )
  2968. ROM_END
  2969.  
  2970.  
  2971. ROM_START( sfootbal )
  2972.     ROM_REGION( 0x40000, REGION_CPU1 )     /* 64k for code for the first CPU, plus 128k of banked ROMs */
  2973.     ROM_LOAD( "sfbab01.bin",  0x10000, 0x4000, 0x2a69803f )
  2974.     ROM_LOAD( "sfbab23.bin",  0x14000, 0x4000, 0x89f157c2 )
  2975.     ROM_LOAD( "sfbab45.bin",  0x18000, 0x4000, 0x91ad42c5 )
  2976.     ROM_LOAD( "sfbcd6ef.bin", 0x2c000, 0x4000, 0xbf80bb1a )
  2977.  
  2978.     ROM_REGION( 0x10000, REGION_CPU2 )        /* 64k for Z80 */
  2979.     ROM_LOAD( "sentesnd",  0x00000, 0x2000, 0x4dd0a525 )
  2980.  
  2981.     ROM_REGION( 0x10000, REGION_GFX1 )        /* up to 64k of sprites */
  2982.     ROM_LOAD( "sfbgr01.bin", 0x00000, 0x4000, 0xe3108d35 )
  2983.     ROM_LOAD( "sfbgr23.bin", 0x04000, 0x4000, 0x5c5af726 )
  2984.     ROM_LOAD( "sfbgr45.bin", 0x08000, 0x4000, 0xe767251e )
  2985.     ROM_LOAD( "sfbgr67.bin", 0x0c000, 0x4000, 0x42452a7a )
  2986. ROM_END
  2987.  
  2988.  
  2989. ROM_START( spiker )
  2990.     ROM_REGION( 0x40000, REGION_CPU1 )     /* 64k for code for the first CPU, plus 128k of banked ROMs */
  2991.     ROM_LOAD( "ab01.u8a",  0x10000, 0x4000, 0x2d53d023 )
  2992.     ROM_LOAD( "ab23.u7a",  0x14000, 0x4000, 0x3be87edf )
  2993.     ROM_LOAD( "cd6ef.u1a", 0x2c000, 0x4000, 0xf2c73ece )
  2994.  
  2995.     ROM_REGION( 0x10000, REGION_CPU2 )        /* 64k for Z80 */
  2996.     ROM_LOAD( "sentesnd",  0x00000, 0x2000, 0x4dd0a525 )
  2997.  
  2998.     ROM_REGION( 0x10000, REGION_GFX1 )        /* up to 64k of sprites */
  2999.     ROM_LOAD( "gr01.u4c", 0x00000, 0x4000, 0x0caa6e3e )
  3000.     ROM_LOAD( "gr23.u3c", 0x04000, 0x4000, 0x970c81f6 )
  3001.     ROM_LOAD( "gr45.u2c", 0x08000, 0x4000, 0x90ddd737 )
  3002. ROM_END
  3003.  
  3004.  
  3005. ROM_START( rescraid )
  3006.     ROM_REGION( 0x40000, REGION_CPU1 )     /* 64k for code for the first CPU, plus 128k of banked ROMs */
  3007.     ROM_LOAD( "ab1.a10",   0x10000, 0x8000, 0x33a76b47 )
  3008.     ROM_LOAD( "ab12.a12",  0x18000, 0x8000, 0x7c7a9f12 )
  3009.     ROM_LOAD( "cd8.a16",   0x20000, 0x8000, 0x90917a43 )
  3010.     ROM_LOAD( "cd12.a18",  0x28000, 0x8000, 0x0450e9d7 )
  3011.  
  3012.     ROM_REGION( 0x10000, REGION_CPU2 )        /* 64k for Z80 */
  3013.     ROM_LOAD( "sentesnd",  0x00000, 0x2000, 0x4dd0a525 )
  3014.  
  3015.     ROM_REGION( 0x10000, REGION_GFX1 )        /* up to 64k of sprites */
  3016.     ROM_LOAD( "gr0.a5",    0x00000, 0x8000, 0xe0dfc133 )
  3017.     ROM_LOAD( "gr4.a7",    0x08000, 0x8000, 0x952ade30 )
  3018. ROM_END
  3019.  
  3020.  
  3021.  
  3022. /*************************************
  3023.  *
  3024.  *    Game drivers
  3025.  *
  3026.  *************************************/
  3027.  
  3028. GAME( 1984, sentetst, 0,        balsente, sentetst, sentetst, ROT0, "Bally/Sente", "Sente Diagnostic Cartridge" )
  3029. GAME( 1984, cshift,   0,        balsente, cshift,   cshift,   ROT0, "Bally/Sente", "Chicken Shift" )
  3030. GAME( 1984, gghost,   0,        balsente, gghost,   gghost,   ROT0, "Bally/Sente", "Goalie Ghost" )
  3031. GAME( 1984, hattrick, 0,        balsente, hattrick, hattrick, ROT0, "Bally/Sente", "Hat Trick" )
  3032. GAME( 1984, otwalls,  0,        balsente, otwalls,  otwalls,  ROT0, "Bally/Sente", "Off the Wall (Sente)" )
  3033. GAME( 1984, snakepit, 0,        balsente, snakepit, snakepit, ROT0, "Bally/Sente", "Snake Pit" )
  3034. GAME( 1984, snakjack, 0,        balsente, snakjack, snakjack, ROT0, "Bally/Sente", "Snacks'n Jaxson" )
  3035. GAME( 1984, stocker,  0,        balsente, stocker,  stocker,  ROT0, "Bally/Sente", "Stocker" )
  3036. GAME( 1984, triviag1, 0,        balsente, triviag1, triviag1, ROT0, "Bally/Sente", "Trivial Pursuit (Genus I)" )
  3037. GAME( 1984, triviag2, 0,        balsente, triviag2, triviag2, ROT0, "Bally/Sente", "Trivial Pursuit (Genus II)" )
  3038. GAME( 1984, triviasp, 0,        balsente, triviasp, triviag2, ROT0, "Bally/Sente", "Trivial Pursuit (All Star Sports Edition)" )
  3039. GAME( 1984, triviayp, 0,        balsente, triviayp, triviag2, ROT0, "Bally/Sente", "Trivial Pursuit (Young Players Edition)" )
  3040. GAME( 1984, triviabb, 0,        balsente, triviabb, triviag2, ROT0, "Bally/Sente", "Trivial Pursuit (Baby Boomer Edition)" )
  3041. GAME( 1985, gimeabrk, 0,        balsente, gimeabrk, gimeabrk, ROT0, "Bally/Sente", "Gimme A Break" )
  3042. GAME( 1985, minigolf, 0,        balsente, minigolf, minigolf, ROT0, "Bally/Sente", "Mini Golf (set 1)" )
  3043. GAME( 1985, minigol2, minigolf, balsente, minigol2, minigol2, ROT0, "Bally/Sente", "Mini Golf (set 2)" )
  3044. GAME( 1985, toggle,   0,        balsente, toggle,   toggle,   ROT0, "Bally/Sente", "Toggle" )
  3045. GAME( 1986, nametune, 0,        balsente, nametune, nametune, ROT0, "Bally/Sente", "Name That Tune" )
  3046. GAME( 1986, nstocker, 0,        balsente, nstocker, nstocker, ROT0, "Bally/Sente", "Night Stocker" )
  3047. GAME( 1986, sfootbal, 0,        balsente, sfootbal, sfootbal, ROT0, "Bally/Sente", "Street Football" )
  3048. GAME( 1986, spiker,   0,        balsente, spiker,   spiker,   ROT0, "Bally/Sente", "Spiker" )
  3049. GAME( 1987, rescraid, 0,        balsente, rescraid, rescraid, ROT0, "Bally/Sente", "Rescue Raider" )
  3050.